Skip to content

Example field from schema's property returns null #75

Description

@Chiggy-Playz

I was using a demo openapi spec file (Swagger Petstore - OpenAPI 3.1) and I discovered that when obtaining Schema using OpenApi.components.schema, the schema object's property shows example field as null but the content I provide has value as ["doggie"]. Here's the schema for Pet

 Pet:
      required:
        - name
        - photoUrls
      type: object
      properties:
        id:
          type: integer
          format: int64
          examples: [10]
        name:
          type: string
          examples: [doggie]
        category:
          $ref: '#/components/schemas/Category'
        photoUrls:
          type: array
          xml:
            wrapped: true
          items:
            type: string
            xml:
              name: photoUrl
        tags:
          type: array
          xml:
            wrapped: true
          items:
            $ref: '#/components/schemas/Tag'
        status:
          type: string
          description: pet status in the store
          enum:
            - available
            - pending
            - sold
      xml:
        name: pet

I used OpenApi.fromString(source: content, format: OpenApiFormat.json); to parse the spec.

Activity

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