Enum referenced with $ref is not shown as dropdown in request header after OpenAPI import
B
Balázs SZÜCS
Hello Apidog Support,
We are importing our API definition from an OpenAPI 3.0.3 specification.
We have several request header parameters where the schema is referenced via $ref. The referenced schema is a string enum, and it also contains the x-apidog-enum extension with names and descriptions.
Example:
parameters:
- in: header
name: x-custom-source
required: true
schema:
$ref: '#/components/schemas/SourceSystemEnum'
components:
schemas:
SourceSystemEnum:
description: Source system identifier
type: string
enum:
- system-a
- system-b
example: system-a
x-apidog-enum:
- value: system-a
name: System A
description: Example source system A
- value: system-b
name: System B
description: Example source system B
After importing the OpenAPI file, the schema itself is recognized correctly in Apidog: if we open the schema/model, the field is shown as an enum and the enum values are visible.
However, when we open an endpoint and try to execute a request in the UI, the request header field is displayed as a simple text input. It does not appear as a dropdown with the possible enum values.
Could you please confirm whether Apidog supports dropdown rendering for request header parameters when the enum schema is referenced via $ref and includes x-apidog-enum?
If this is supported, could you let us know what the expected OpenAPI structure should be?
Thank you.
franki
Hello, thank you for your feedback. Currently, the form does not support dropdown rendering of enum models referenced via $ref. When the schema of a parameter uses $ref to reference an enum, it cannot be rendered as a dropdown select box after import.
Temporary solution: Replace the $ref in the parameter with an inline schema definition, and the dropdown options will display normally:
Example:
parameters:
- in: header
name: x-custom-source
required: true
schema:
type: string
enum: [system-a, system-b]
x-apidog-enum:
- value: system-a
name: System A
- value: system-b
name: System B
I have submitted this issue to the product team for evaluation, and we will consider supporting the dropdown rendering of form $ref referencing enum models in the future.