Skip to content

v3.1+: Should new guidance be given for example and the Example Object's value and externalValue? #4659

Open
@handrews

Description

@handrews

These fields have usually been interpreted by us as requiring serialized values, but this is called into question on an (at least) annual basis (2022, 2023 (mostly on Slack), 2024, 2025).

There are several causes of the confusion:

  • Some find the wording (whether in 3.0.4/3.1.1 or earlier releases) specifying that these are encoded/escaped/serialized values unclear
  • There is debate over what is or is not "easily represented in JSON/YAML," which can result in tools parsing a string that was intended to just be a string, or failing to parse a string that was intended to be a serialization of a more complex structure
  • There is debate over what things like parameter names are or are not included in the serialization

@hudlow surveyed some implementations and found that:

  • Spectral (2.7K stars): error for serialized example values
  • Redocly (1.2K stars): error for serialized example values
  • Vacuum (767 stars): error for serialized example values
  • IBM OpenAPI Validator (549 stars): error for serialized example values

@mikekistler has suggested clarifying these and recommending something based on how tools actually implement them.

@handrews has suggested just declaring them "implementation-defined" in 3.2 and leaving things as they are in 3.1, partially out of concern for what can be done in a patch release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    example obj/keywordsIssues with the Example Object or exampel(s) keywords

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions