Skip to content

convertV2: different example for ENUM  #817

@thim81

Description

@thim81

I have this request body & query param Components with an ENUM, which chooses a different value everytime, while I was expecting that the example would be taken always.

This only happens when using the convertV2, with the convert it always returned type: "<string>"

Request body component:

    Website:
      type: object
      required:
        - url
      properties:
        id:
          type: string
          example: '12345'
          nullable: true
        url:
          type: string
          example: 'http://example.com'
          minLength: 1
        type:
          type: string
          enum:
            - primary
            - secondary
            - work
            - personal
            - other
          example: primary

Expected depending on the parametersResolution: type: primary or type: "<string>" but every time got a different ENUM value like type: secondary, type: work

Query param component:

    ContactsSort:
      type: object
      x-graphql-type-name: ContactsSort
      example:
        by: created_at
        direction: desc
      properties:
        by:
          type: string
          description: The field on which to sort the Contacts
          enum:
            - created_at
            - updated_at
            - name
            - first_name
            - last_name
            - email
          example: created_at
        direction:
          type: string
          description: The direction in which to sort the Contacts
          enum:
            - asc
            - desc
          default: asc
      required:
        - by
      additionalProperties: false

depending on the parametersResolution: by: created_at or by: "<string>" but every time got a different ENUM value like by: first_name, by: updated_at

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