muonsoft / openapi-mock

OpenAPI mock server with random data generation
MIT License
492 stars 55 forks source link

Feature request: Declare ID field types #66

Open alkal opened 2 years ago

alkal commented 2 years ago

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 commented 10 months ago

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