Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Schema format #1193

Closed
Herrick19 opened this issue Jun 22, 2020 · 6 comments
Closed

Feature request: Schema format #1193

Herrick19 opened this issue Jun 22, 2020 · 6 comments

Comments

@Herrick19
Copy link

Hi,

It would be nice if you could support all of the OAS 3 imported types from JSON Schema. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#schema-object

  • title
  • multipleOf
  • maximum
  • exclusiveMaximum
  • minimum
  • exclusiveMinimum
  • maxLength
  • minLength
  • pattern
  • maxItems
  • minItems
  • uniqueItems
  • maxProperties
  • minProperties
  • required
  • enum

Also the nullable, readOnly, writeOnly

Ideally, the valid choices would be related to the data type.

For example for strings:

  • maxLength
  • minLength
  • pattern

For integers and float:

  • multipleOf
  • maximum
  • exclusiveMaximum
  • minimum
  • exclusiveMinimum

For arrays:

  • maxItems
  • minItems
  • uniqueItems

For objects:

  • maxProperties
  • minProperties

Support for this is very rare and would make apicurio the most complete Editor beside commercial products

Thanks in advance for considering

@vvilerio
Copy link

Hi,
I'm starting to work on , today :)

@vvilerio
Copy link

minmax

@pedy711
Copy link

pedy711 commented Jan 7, 2022

could you please give me an example of the pattern for an enum?

I want to have id and displayed name separately. Would that be possible with a pattern?

Ex:
enum { TEST_1: "fast", TEST_2: "medium" TEST_3: "slow" }

@vvilerio
Copy link

@see https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object

pattern (This string SHOULD be a valid regular expression, according to the Ecma-262 Edition 5.1 regular expression dialect)

@pedy711
Copy link

pedy711 commented Jan 11, 2022

@vvilerio thanks for your comment, but I am still unsure if what I want to achieve is doable in OpenAPI Specification. I would be thankful if you could help me out.

I want to build the following that contains id and label for enums.

Ex:
enum { TEST_1: "fast", TEST_2: "medium" TEST_3: "slow" }

@EricWittmann
Copy link
Member

I think enough of this feature request has been implemented that we can close it. Thanks @vvilerio !

As for @pedy711 - enums in OpenAPI are just a list of possible values for a property. If you wanted to model something with multiple values, you'll need to find another way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants