OAI / OAI/OpenAPI-Specification

Indicate that parameterObject has dynamic enum ?

Open
#2,313 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

param serialization schema-object
Dominant language
Markdown
Stars
31.2k
Forks
9.2k
Avg merge
6h 37m
Merged PRs (30d)
27

Description

I try to have a parameter, which enum values has to be requested from different endpoint. So I haven't found any way how I could do it in specification. I though about 2 ways or I indicate that enum is dynamic with additionalProperties or I use $ref as value for enum attribute but not sure if this will be with accordance to specification ?

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject

{
  "in": "query",
  "name": "name",
  "$ref" : "#/paths/enums/name",
  "schema": {
    "type": "object",
    "additionalProperties": {
       "dynamicEnum": "bool"
    },
    "enum": {"$ref" : "#/paths/enums/name"}
  }
}

Any thoughts ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked OpenAPI 3.0.2 Parameter Object section and compare its enum and $ref rules with the proposed dynamic-enum examples. Determine whether the specification should support remotely requested enum values; done requires a decided, specification-compliant proposal rather than only an implementation.

Written by the indexing model from the issue text.

Assessment

Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.