mike-oakley / openapi-pydantic

Pydantic OpenAPI schema implementation
Other
63 stars 10 forks source link

A couple of enhancements #41

Open rafalkrupinski opened 2 months ago

rafalkrupinski commented 2 months ago

Some enhancements I'd be happy port from my project:

Also, Paths could be changed to dict[str, PathItem | Reference], and ref could be removed from PathItem. this is valid

rafalkrupinski commented 2 weeks ago

@mike-oakley

mike-oakley commented 1 week ago

Hey @rafalkrupinski - apologies for my slow reply here! Commented on the other issues too, but in general i'm happy to accept contributions if its enhancing/within the spirit of openapi/pydantic and maintains support for oas 3.0.x and pydantic 1 + 2.

The only one I'm not sure of in the above is the ref resolver, not sure if it would bloat the surface area of the project too much to be opinionated on it, as we try to defer to Pydantic for most of the heavy lifting on the JSONSchema side. Happy to hear a suggestion if you can suggest an elegant enough API for it 👍🏼

rafalkrupinski commented 1 week ago

Resolving references is actually quite simple.

It could be a method in OpenAPI and a couple of helper functions. I have the code already in my project, I'll prepare a PR.

rafalkrupinski commented 1 week ago

@mike-oakley you don't think running mypy on tests is an overkill?