Skip to content

Support for openapi formats (int64, int32, date, date-time) #1239

Description

@belgattitude

I'm currently evaluating valibot/tojsonschema to generate openapi specs.

Currently stuck on v.bigint() and trying to generate a format spec like

const schema = v.bigint()
///
type: string
format: int64
description: Big integer as a string (int64), since JSON does not support true 64-bit integers.

https://spec.openapis.org/oas/v3.1.0#data-types

Is it something that is planned ?

I saw

More conversion options
Convert schemas into JSON schema definitions
Convert non JSON types to similar, yet different types (for example: Date into format: 'date-time' or format: 'unix-> time', BigInt into format: 'int64' or string, explicit undefined into null, etc.)

In the initial support PR: #802 by @gcornut

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststaleIssue has not had recent activity or appears to be solved. Stale issues will be automatically closed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions