-
Notifications
You must be signed in to change notification settings - Fork 383
Description
Stoplight generates a UUID when a property format is set to uuid. For example:
{"title":"Uuid","type":"string","format":"uuid"}
Proposal: do the same when format is uuid4.
Reason: Pydantic, a commonly used library in the Python ecosystem, uses that notation for UUIDs.
At the moment, Stoplight (or actually, json-schema-faker) is generating a string for my UUID fields, as it does not know about the uuid4 format. (FWIW: "format is an open value, so you can use any formats, even not those defined by the OpenAPI Specification" (https://swagger.io/docs/specification/v3_0/data-models/data-types/))
I could of course work around this by setting x-faker (as instructed on https://docs.stoplight.io/docs/prism/9528b5a8272c0-dynamic-response-generation-with-faker#how-it-works), but as its value is specified to the JavaScript library (datatype.uuid), that's doesn't belong in a general-purpose OpenAPI spec.