You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "$ref" field in the openapi-schema only has a limited set of characters allowed. If I use a Generic Model as the schema_class parameter for "PydanticSchema", the square brackets "[]" won't get removed, which results in an invalid schema.
Pydantic itself removes all invalid characters in "GenerateJsonSchema.normalize_name" (https://github.com/pydantic/pydantic/blob/main/pydantic/json_schema.py#L1939 ).
The "$ref" field in the openapi-schema only has a limited set of characters allowed. If I use a Generic Model as the schema_class parameter for "PydanticSchema", the square brackets "[]" won't get removed, which results in an invalid schema.
Pydantic itself removes all invalid characters in "GenerateJsonSchema.normalize_name" (https://github.com/pydantic/pydantic/blob/main/pydantic/json_schema.py#L1939 ).
Reproduce:
This results in
where as it should be:
to work with Pydantic:
I have a quick fix ready (basically copied the regex from "GenerateJsonSchema.normalize_name" to "_construct_ref_obj", but no test yet (https://github.com/jfschneider/openapi-pydantic/blob/normalize-refname/openapi_pydantic/util.py#L173)
The text was updated successfully, but these errors were encountered: