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

Semantic error at components.schemas.registered.allOf.0.properties.tracking_events (missing item field) #258

Closed
1 task
Kilo59 opened this issue Oct 18, 2021 · 1 comment · Fixed by #259
Closed
1 task

Comments

@Kilo59
Copy link
Contributor

Kilo59 commented Oct 18, 2021

Versions

  • of Node: NA
  • of OpenAPI on branch you pulled from:
    • Are you up to date with main (Y/N)?: Yes
  • of any relevant packages (optional):

Description

According the editor.swagger.io there is a semantic error on line 6362 due to a missing item field that is required for array types.

https://github.com/lob/lob-openapi/blob/main/dist/lob-api-bundled.yml#L6362-L6365

Errors
Semantic error at components.schemas.registered.allOf.0.properties.tracking_events
Schemas with 'type: array', require a sibling 'items: ' field
Jump to line 6362

Steps to Reproduce:

  1. Go to https://editor.swagger.io/
  2. Enter the contents of https://github.com/lob/lob-openapi/blob/main/dist/lob-api-bundled.yml into the editor
  3. Wait for the SwaggerUI to render.

Expected Behavior

The SwaggerUI should render without errors.

Screenshots

Screen Shot 2021-10-18 at 8 51 37 AM
Screen Shot 2021-10-18 at 9 06 45 AM

Additional Context (optional)

Solution seems to be just adding the items field to $ref a tracking_event object.

  • My question is why didn't our API spec linter catch the issue? Is editor.swagger.io wrong/out of date and this is not a semantic error as of openapi: 3.0.3?
@Kilo59
Copy link
Contributor Author

Kilo59 commented Oct 18, 2021

I think I understand why this was left out since according to the description. This array will always be empty (after a create call).

description: Tracking events are not populated for registered letters.

But I still think the array needs a type (if only to eliminate the semantic error).

https://stackoverflow.com/questions/29624921/how-to-define-empty-array-in-swagger

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

Successfully merging a pull request may close this issue.

1 participant