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

Support format: uuid #707

Open
liambutler-lawrence opened this issue Dec 19, 2024 · 1 comment
Open

Support format: uuid #707

liambutler-lawrence opened this issue Dec 19, 2024 · 1 comment
Labels
area/openapi Adding/updating a feature defined in OpenAPI. kind/feature New feature. status/blocked Waiting for another issue.

Comments

@liambutler-lawrence
Copy link

Motivation

Our API spec heavily uses UUID-typed fields, which are represented in our OpenAPI doc using format: uuid as described in the JSONSchema spec.

However, swift-openapi-generator currently ignores that part of the OpenAPI doc and generates them all as Swift.String, meaning we have to manually call UUID.uuidString and UUID(uuidString:) (and implement required error handling on the latter).

Proposed solution

Make the generator respect format: uuid and define such fields using the Swift UUID type.

Alternatives considered

No response

Additional information

No response

@liambutler-lawrence liambutler-lawrence added kind/feature New feature. status/triage Collecting information required to triage the issue. labels Dec 19, 2024
@simonjbeaumont
Copy link
Collaborator

Thanks for filing this @liambutler-lawrence.

This is a duplicate of #375, which is a more general ask for generating more typed values.

There's an open PR, #627, that specifically adds support for UUID, but that's currently blocked on working out a backwards compatibility story (see #627 (comment)).

@simonjbeaumont simonjbeaumont added area/openapi Adding/updating a feature defined in OpenAPI. status/blocked Waiting for another issue. and removed status/triage Collecting information required to triage the issue. labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/openapi Adding/updating a feature defined in OpenAPI. kind/feature New feature. status/blocked Waiting for another issue.
Projects
None yet
Development

No branches or pull requests

2 participants