Skip to content

swagger-cli validate ./openapi.yaml fails while adding examples in request body with $ref for content #2983

Closed

Description

@LakshmiLavanyaKasturi

openapi: 3.0.2

API example:

requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: ./api/rosetta/rosetta-account-balance-request.schema.json
            examples:
              network_identifier:
                value: [mainnet]
              account_identifier: 
                value: [SPZ5DJGRVZHXEEEYYGWEX84KQB8P69GC715ZRNW1]

Output:

Swagger schema validation failed.
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody/content/application~1json/schema must NOT have additional properties
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody/content/application~1json/schema must have required property '$ref'
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody/content/application~1json/schema must match exactly one schema in oneOf
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody must have required property '$ref'
  #/paths/~1rosetta~1v1~1account~1balance/post/requestBody must match exactly one schema in oneOf

Activity

  1. locked and limited conversation to collaborators on Jul 25, 2022
  2. converted this issue into a discussion #2984 on Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions