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 custom primitives with arbitrary formats #652

Open
susliko opened this issue Oct 8, 2021 · 0 comments
Open

Support custom primitives with arbitrary formats #652

susliko opened this issue Oct 8, 2021 · 0 comments

Comments

@susliko
Copy link
Contributor

susliko commented Oct 8, 2021

Currently SwaggerPrimitive is defined as

class SwaggerPrimitive[Typ <: SwaggerValue](
    val format: Option[OpenApiFormat[Typ]] = None,
    ...
) 

where OpenApiFormat is a sealed trait. This means that one cannot define custom primitives with arbitrary formats whilst the OpenAPI Data Types spec states:

However, format is an open value, so you can use any formats, even not those defined by the OpenAPI Specification,
...
Tools can use the format to validate the input or to map the value to a specific type in the chosen programming language. Tools that do not support a specific format may default back to the type alone, as if the format is not specified.

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

No branches or pull requests

1 participant