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

allOf not working properly within array items #136

Closed
joostfarla opened this issue Nov 4, 2016 · 8 comments
Closed

allOf not working properly within array items #136

joostfarla opened this issue Nov 4, 2016 · 8 comments
Assignees

Comments

@joostfarla
Copy link

This works correctly:

responses:
  '200':
    description: OK
    schema:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: 'someDefinition.yaml'

This initially loads fine, but gives an error (Can't load schema at ..) when trying to expand the data element in the response schema:

responses:
  '200':
    description: OK
    schema:
      type: object
      properties:
        data:
          type: array
          items:
            allOf:
              - $ref: 'someDefinition.yaml
              - xml
                  name: foo

The schema example on the right side seems to render correctly.

@RomanHotsiy RomanHotsiy self-assigned this Nov 4, 2016
@RomanHotsiy
Copy link
Member

@joostfarla, Thanks for reporting. I was able to reproduce the issue.
The fix shouldn't take so much time so most likely it will be included in the next minor release.

@joostfarla
Copy link
Author

@RomanGotsiy Awesome! 👍

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Nov 5, 2016

Fixed, will be ready for use in the next minor release which will be released at the beginning of the next week.
I will let you know here

@joostfarla
Copy link
Author

Thanks for the fix! I've now actually found more scenarios where this causes failure.

For example the following HAL response:

get:
  summary: GET /datasets
  responses:
    '200':
      description: OK
      schema:
        allOf:
          - $ref: 'Collection.yaml'
          - type: object
            required:
              - _embedded
            properties:
              _embedded:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: 'Dataset.yaml'

Collection.yaml

type: object
required:
  - totalItems
  - _links
properties:
  totalItems:
    type: integer
    format: int32
  _links:
    type: object
    required:
      - next
    properties:
      next:
        type: object
        required:
          - href
        properties:
          href:
            type: string

Dataset.yaml

type: object
required:
  - id
  - name
properties:
  id:
    type: string
  name:
    type: string

Can you take a look at this?

@joostfarla
Copy link
Author

@RomanGotsiy did you already had the chance to look at this issue? I don't mean to rush, but I'm presenting stuff next week, and it would be awesome if I have a fully working doc page. 👍

@RomanHotsiy
Copy link
Member

@joostfarla yes, sorry for delay. I've been working on other things. Will publish new release on weekends

@RomanHotsiy
Copy link
Member

@joostfarla new version v1.5.2 has been just released.
Let me know if it the issue is solved for you know

@joostfarla
Copy link
Author

Works like a charm! Thanks!! 👍

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

No branches or pull requests

2 participants