0

The issue with creating documentation when using re-usable enums My yaml file looks like this

openapi: 3.0.2 components:   schemas:
    Countries:
      type: string
      enum:
        - Unknown
        - Afghanistan
        - Albania
        - Algeria
        - American Samoa
        - "\u00c5landIslands"
        - NotOtherwiseSpecified

, when I compile it creates the java classes correctly, however, is not creating the documentation, just gives me:

Countries- and nothing more is displayed for that particular scheme. For the other schemes enum options are displayed, etc. Can you help me with this problem? Is this an issue of swagger or I am mistaken somewhere. The example in the swagger website and my code are following the same rules: https://swagger.io/docs/specification/data-models/enums/. I also posted similar question here: https://community.smartbear.com/t5/SwaggerHub/Issue-with-creating-a-documentation-when-using-re-usable-enums/m-p/191938

P.S. I thought the problem is coming because of the special character, but it is not. I tried without that specific enum entry and also I have another similar way reusable enum that behaves the same way.

Sim
  • 49
  • 12

1 Answers1

0

This is working fine for me. I am attaching an example for reference of how I am doing it.

Parameters in route.yaml

      parameters:
        - name: Country
          in: query
          required: true
          schema:
            $ref: "#/components/schemas/test"

Declaration in parameters.yaml

components:
  schemas:
    test:
      type: string
      enum:
        - Unknown
        - Afghanistan
        - Albania
        - Algeria
        - "\u00c5landIslands"

Attaching the image from Swagger UI enter image description here

Please add some more details for reference as above mentioned are working fine for me.

abhishek
  • 73
  • 1
  • 8