open-api-spex / open_api_spex

Open API Specifications for Elixir Plug applications
Mozilla Public License 2.0
706 stars 183 forks source link

OpenAPI 3.1.0 Support #637

Open Stratus3D opened 1 week ago

Stratus3D commented 1 week ago

I'd like to use Open API Spex to generate OpenAPI 3.1 specifications that can be consumed by another system that uses JSON Schema. OpenAPI 3.1 has been out several years now and I'm wondering if support will ever be added to this library. Changes between OpenAPI 3.0 and 3.1 are minimal, but there are changes that would need to make to this library to support it. The biggest one for me right now is using multiple types to indicate a field may be null. Open API Spex does not allow a list for schema type.

Invalid schema.type. Got: [:string, :null] at /my/0/field/location

There are a few other changes, but I don't think they'd be a ton of work to implement. The bigger challenging would be supporting both 3.0 and 3.1 at the same time if that is desired. I'm happy to contribute if there is a clear path to getting this library to OpenAPI 3.1. Thanks!