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.

Is "examples" (plural) supported inside schemas in 3.0.x?

See original GitHub issue

OpenAPI Specification versions: 3.0.0, 3.0.1

The Example Object Example section demonstrates the usage of the examples (plural) keyword inside a schema:

# in a model
schemas:
  properties:
    name:
      type: string
      examples:
        name:
          $ref: http://example.org/petapi-examples/openapi.json#/components/examples/name-example

However, the Schema Object description only mentions the example keyword (singular) but not examples (plural).

Is examples actually supported inside schemas? Or is the abovementioned example invalid?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
handrewscommented, Nov 27, 2018

@mindstretch23 assuming alternativeSchema makes it into 3.1, and tooling vendors start supporting modern drafts (most likely the really-soon-now-I-promise draft-08), you would be able to use any JSON Schema feature that tool vendors recognize.

2reactions
darrelmillercommented, Feb 27, 2018

@hkosova That’s an error in my opinion. Our goal was to bring our schema object closer to JSON Schema, not to add more stuff to it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenAPI Specification - Version 3.0.3 - Swagger
OpenAPI Specification. Version 3.0.3. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", ...
Read more >
OpenAPI Examples Need Help
A schema can have an example for an entire object, part of an object, or a single specific property inside that object. #...
Read more >
OpenAPI Specification v3.0.3 | Introduction, Definitions, & More
The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This...
Read more >
Breaking changes in EF Core 5.0 - Microsoft Learn
INavigationBase replaces INavigation in some APIs to support skip ... To go back to the 3.x behavior, configure the id property in ...
Read more >
A Media Type for Describing JSON Documents - JSON Schema
JSON Schema is defined over "application/json" or compatible documents, ... Keywords which are properties within the same schema object are referred to as ......
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