Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Support custom primitives with arbitrary formats #652

@susliko

Description

@susliko

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions