OpenAPITools / OpenAPITools/openapi-generator
[REQ] Add support for UUID in typescript-fetch generator
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
UUID type is extremely common in REST APIs.
Most, if not all, resources fetched from a REST API contain an ID and most of the time, this ID is a UUID
OpenAPI already supports the uuid type with the following notation:
"MyObject": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
},
"required": [
"id"
]
},
It could be great if the generator was able to generate this kind of code:
export interface MyObject {
/**
*
* @type {uuid}
* @memberof MyObject
*/
id: uuid;
}
This support might require the addition of a library (https://www.npmjs.com/package/@types/uuid) so the generation of UUID fields could be optional and only activated with a flag
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the typescript-fetch generator and its existing OpenAPI format-to-TypeScript type mappings. Review any generated-output tests or option definitions you find; done should mean OpenAPI string fields with format uuid produce the intended UUID type, with the proposed optional behavior clarified and covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100