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

Include array items in the output of GetAllSchemas #153

Closed
2ynn opened this issue Aug 17, 2023 · 2 comments
Closed

Include array items in the output of GetAllSchemas #153

2ynn opened this issue Aug 17, 2023 · 2 comments

Comments

@2ynn
Copy link

2ynn commented Aug 17, 2023

GetAllSchemas does not return index references nested under items in an array.

For instance, considering this component:

components:
  schemas:
    Array:
      type: array
      items:
        type: skipped
          properties:
            name:
              type: found

the paths associated with the index references returned by GetAllSchemas are :

  • $.components.schemas.Array
  • $.components.schemas.Array.items.properties.name

While we would expect this one to also be included in the output :

  • $.components.schemas.Array.items

As a result it is not straightforward to perform type checking on the type: skipped node.

Quote from dischord:

the issue here is that 'items' is not being picked up by the index, is that it literally does not have a key of 'schema', but rather 'items'. Right now, this is expected behavior, based on the code, which is here: https://github.com/pb33f/libopenapi/blob/main/index/extract_refs.go#L43

@TristanSpeakEasy
Copy link
Contributor

This PR addresses the above issue plus all other places schemas can be found inline

@daveshanley
Copy link
Member

Merged!

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

3 participants