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

Allow binding types as parameters through String() methods #638

Merged
merged 1 commit into from Jun 29, 2022

Conversation

jamietanna
Copy link
Collaborator

If trying to use a type, such as a UUID in a path parameter, we'd
previously receive an error at runtime to say that types.UUID isn't
supported.

As this is a common use case, we should support it. Instead of adding
support for it manually, we can instead look at whether the there's a
String method, and if so use that to serialise the field.

@jxsl13
Copy link

jxsl13 commented Jun 20, 2022

fmt.Stringer

If trying to use a type, such as a UUID in a path parameter, we'd
previously receive an error at runtime to say that `types.UUID` isn't
supported.

As this is a common use case, we should support it. Instead of adding
support for it manually, we can instead look at whether the there's a
`String` method, and if so use that to serialise the field.
@jamietanna
Copy link
Collaborator Author

Looks like it may already be covered by #608 ?

@jamietanna
Copy link
Collaborator Author

@deepmap-marcinr @yangzh-deepmap sorry for the small nudge, but would it be possible to have a look? 🙏

Looks like this will help a few folks!

@deepmap-marcinr deepmap-marcinr merged commit 6e0423f into deepmap:master Jun 29, 2022
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
…#638)

If trying to use a type, such as a UUID in a path parameter, we'd
previously receive an error at runtime to say that `types.UUID` isn't
supported.

As this is a common use case, we should support it. Instead of adding
support for it manually, we can instead look at whether the there's a
`String` method, and if so use that to serialise the field.
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

Successfully merging this pull request may close these issues.

None yet

3 participants