question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jsonapi included array

See original GitHub issue

I apologize if this has been asked and answered but I cannot seem to get this to work

responses:
        '200':
          description: returns a jsonapi driver object
          content:
            'application/vnd.api+json':
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/driver'
                  included:
                    type: array
                    items:
                      enum:
                      - $ref: '#/components/schemas/account'
                      - $ref: '#/components/schemas/reservation-term'
                      - $ref: '#/components/schemas/term-agreement'
                      - $ref: '#/components/schemas/mobile-device'
                      - $ref: '#/components/schemas/driver-notification'
                  meta:
                    type: object
                    properties:
                      jwt:
                        type: string
                      subdomain:
                        type: string

In the example above it does not error, but it displays an array with a single empty {}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
handrewscommented, Mar 2, 2018

@MikeRalphson @webron @darrelmiller I think we can close this as answered? (and by “we” I mean “you” 😃

1reaction
rossi-jeffcommented, Jan 25, 2018

thank you for the very fast response

On Jan 25, 2018, at 4:41 PM, Henry Andrews notifications@github.com wrote:

If you want alternate schemas, use oneOf or anyOf

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OAI/OpenAPI-Specification/issues/1465#issuecomment-360609640, or mute the thread https://github.com/notifications/unsubscribe-auth/AAo9WHIEdesDipEGxxQRZ9IUvHXVYAKtks5tOPT2gaJpZM4RthTL.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON:API — Latest Specification (v1.1)
In a compound document, all included resources MUST be represented as an array of resource objects in a top-level included member. Every ...
Read more >
Render an array with JSONAPI and Rails - Stack Overflow
In theory, I was suppose to use .serializable_hash to serialize a collection, like ProductSerializer.new(products, { include: [:tags] }).
Read more >
JSON API Cheatsheet - Key Shift in Cmd
included. No. When data is not present. Array of resource objects that are either: Related to the primary data and/or; Related to each...
Read more >
specifying more than one include query param with [] causes a ...
Problem/Motivation A JSON:API URL with more than one include query ... 187) Drupal\jsonapi\IncludeResolver::toIncludeTree(Object, Array) ...
Read more >
jsonapi - Go Packages
Package jsonapi provides a serializer and deserializer for ... In other words, there will be no, "included", array in the json all ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found