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: Declare ID field types #66

Open
alkal opened this issue Nov 24, 2021 · 1 comment
Open

Feature request: Declare ID field types #66

alkal opened this issue Nov 24, 2021 · 1 comment

Comments

@alkal
Copy link

alkal commented Nov 24, 2021

I decide to select an openapi-mock package to mock swagger responses. Using the package, I found out that some fields that are used as id fields and their type are “string” return a long charset.

Screenshot 2021-11-24 at 14 38 11

Is it possible to exist a configuration variable where id fields will be declared and their response will be familiar with their type (i.e UA23456 or B120-20 etc.)?

@mscansian
Copy link

You can define the format in your specification:

type: string
format: uuid

If it's a numeric ID you can use an integer

type: integer
minimum: 1

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

No branches or pull requests

2 participants