Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which OpenAPI version(s) is officially supported? #1647

Open
sammy-da opened this issue Nov 29, 2022 · 3 comments
Open

Which OpenAPI version(s) is officially supported? #1647

sammy-da opened this issue Nov 29, 2022 · 3 comments

Comments

@sammy-da
Copy link

sammy-da commented Nov 29, 2022

I can't find the openapi version guardrail is targeting in the docs.
(I suggest displaying this info on the docs front page, or similar)

is version 3.1.0 supported?

@blast-hardcheese
Copy link
Member

I can't find the openapi version guardrail is targeting in the docs.

We support the versions of swagger and openapi that are recognized by the underlying parser, we have no direct control over that ourselves.

is version 3.1.0 supported?

Possibly, but even if the feature you're looking for has been added to the parser, someone would need to add that feature to guardrail itself.

The goal of this project is to have more consistent codegen based on ASTs, but that doesn't give us anything for free from the openapi-codegen libraries.

Does this answer your question? What was it that you were looking for? Did you try something and find it not working as you expected?

@sammy-da
Copy link
Author

sammy-da commented Dec 1, 2022

Does this answer your question?

It kinda does, thanks.

What was it that you were looking for?

I'm trying to upgrade an openapi 3.0 doc for an API to 3.1, because i wanted to make use of a new feature:
OAI/OpenAPI-Specification#2407

Did you try something and find it not working as you expected?

My existing 3.0 doc works fine with guardrail, but when i tried to bump to 3.1, code-generation is failing.
(i was expecting it to work as the only change i made is the openapi version bump)
I guess i'll submit a separate issue for that though.

@sammy-da
Copy link
Author

sammy-da commented Dec 1, 2022

Did you try something and find it not working as you expected?

My existing 3.0 doc works fine with guardrail, but when i tried to bump to 3.1, code-generation is failing.
(i was expecting it to work as the only change i made is the openapi version bump)
I guess i'll submit a separate issue for that though.

But in case you're wondering:

Error:Unknown type for the following structure (No type definition, class: io.swagger.v3.oas.models.media.JsonSchema, .components.schemas.AccountToken):
  Tracker(class JsonSchema {
      class Schema {
          type: [string]
          format: jwt
          description: A JWT access token for your account.
      }
  }, Vector(.components, .schemas, .AccountToken))

which corresponds to this in the doc:

{
   "components": {
      "schemas": {
         "AccountToken": {
            "description": "A JWT access token for your account.",
            "format": "jwt",
            "type": "string",
            "x-scala-type": "String"
         }
      }
   }
}

Built using the latest version of the sbt plugin (0.75.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants