Generates a JSON schema that matches a schema that defines a URL. Args: schema: The core schema. Returns: The generated JSON schema.
(self, schema: core_schema.UrlSchema)
| 2047 | return content_json_schema |
| 2048 | |
| 2049 | def url_schema(self, schema: core_schema.UrlSchema) -> JsonSchemaValue: |
| 2050 | """Generates a JSON schema that matches a schema that defines a URL. |
| 2051 | |
| 2052 | Args: |
| 2053 | schema: The core schema. |
| 2054 | |
| 2055 | Returns: |
| 2056 | The generated JSON schema. |
| 2057 | """ |
| 2058 | json_schema = {'type': 'string', 'format': 'uri', 'minLength': 1} |
| 2059 | self.update_with_validations(json_schema, schema, self.ValidationsMapping.string) |
| 2060 | return json_schema |
| 2061 | |
| 2062 | def multi_host_url_schema(self, schema: core_schema.MultiHostUrlSchema) -> JsonSchemaValue: |
| 2063 | """Generates a JSON schema that matches a schema that defines a URL that can be used with multiple hosts. |