zero-rails_openapi icon indicating copy to clipboard operation
zero-rails_openapi copied to clipboard

Support Open API 3.1.0

Open barnaclebarnes opened this issue 1 year ago • 1 comments

I'm trying to use Scooma to validate the API but it requires OpenAPI 3.1.0. I'm not sure if there are any breaking changes that affect the generator - https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0

Either we can change this to hard code 3.1.0 or allow overriding this in the config?

# lib/open_api.rb:52
`openapi: '3.0.0'`

barnaclebarnes avatar Aug 16 '24 01:08 barnaclebarnes

According to this article, to upgrade to 3.1, may need to make these changes:

  1. type keyword supports multiple types (including null).
  2. values accepted by exclusiveMinimum and exclusiveMaximum is changed.
  3. example keyword is removed.
  4. the way to describe file uploads is changed (and I'm not sure if the 3.0 writing (type: string format: binary) is still compatible).

If your JSON does not involve the above issues, you can hard code it to 3.1.

Maybe I can make a configurable version, but it seems better to reslove the above issues first.

zhandao avatar Aug 16 '24 02:08 zhandao