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

Invalid OpenAPI 2.0 specification: #1208

Closed
1 of 6 tasks
Tiernan-Stapleton opened this issue Jul 14, 2021 · 2 comments
Closed
1 of 6 tasks

Invalid OpenAPI 2.0 specification: #1208

Tiernan-Stapleton opened this issue Jul 14, 2021 · 2 comments
Assignees

Comments

@Tiernan-Stapleton
Copy link

Type of issue

  • Typo
  • Unclear or confusing
  • Missing important information
  • Missing link
  • Bug in the docs code or a template
  • Issue with the API

The problematic page:
https://github.com/logzio/logz-docs/blob/master/_source/api/logzio-public-api.yml#L364
https://github.com/logzio/logz-docs/blob/master/_source/api/logzio-public-api.yml#L3236
https://github.com/logzio/logz-docs/blob/master/_source/api/logzio-public-api.yml#L448

Describe the issue

I am attempting to generate a golang client of your API, using https://github.com/go-swagger/go-swagger v0.27.0.
When running the command

$ swagger generate client -f ./logzio_api.yml --template=stratoscale

I get the following spec validation errors, and am unable to generate a golang client.
(The 'stratoscale' template style is being used so that the generated client returns errors instead of panicing on errors, and it allows for easier generation of mocks, because of the way that endpoints are encoded.)

The swagger spec at "...../logzio_api.yml" is invalid against swagger specification 2.0. see errors :
- "paths./v2/security/rules/search.post.parameters" must validate one and only one schema (oneOf). Found none valid
- paths./v2/security/rules/search.post.parameters.schema.oneOf in body is a forbidden property
- "paths./v1/alerts/triggered-alerts.post.parameters" must validate one and only one schema (oneOf). Found none valid
- paths./v1/alerts/triggered-alerts.post.parameters.in in body should be one of [header]
- paths./v1/alerts/triggered-alerts.post.parameters.in in body should be one of [body]
- "paths./v1/account-management/time-based-accounts/{id}.put.parameters" must validate one and only one schema (oneOf). Found none valid
- paths./v1/account-management/time-based-accounts/{id}.put.parameters.schema.oneOf in body is a forbidden property
- "paths./v1/account-management/time-based-accounts.post.parameters" must validate one and only one schema (oneOf). Found none valid
- paths./v1/account-management/time-based-accounts.post.parameters.schema.oneOf in body is a forbidden property

The issue seems to stemming from the usage of the

     parameters:
        - in: body
          name: foo
          schema:
            oneOf:
              - $ref: '#/definitions/A'
              - $ref: '#/definitions/B'

schema style, where the 'oneOf' is not valid OpenAPI 2.0 spec.

@YajB
Copy link
Contributor

YajB commented Jul 14, 2021

@Tiernan-Stapleton,
Thanks for bringing this to our attention. Will have our team look into the issue.

@YajB
Copy link
Contributor

YajB commented Jul 19, 2021

Resolved in #1210

@YajB YajB closed this as completed Jul 19, 2021
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

5 participants