You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON Schema specification allows for modeling resource identifiers, such as URIs and IRIs, using the format keyword to specify that a string is of a specific type (e.g., uri, iri, uuid).
For example, in JSON Schema, this can be defined as follows:
To the best of my understanding, CUE does not directly support the URI or IRI string formats as part of its standard types. What is the recommended approach or best practice in CUE for modeling such formats?
The text was updated successfully, but these errors were encountered:
Currently AFAIK best approach is to use a regular expression (the first one I came across is here) but that's not ideal, clearly, given the size of it.
We should add a validator for this format, perhaps in a new net/url package. Given that we will want to support JSONSchema formats directly when importing JSON Schema into CUE, we will probably have direct support for most or all of those formats in the near(ish) future. Watch this space!
mvdan
changed the title
Model URI and IRI Formats from JSON Schema in CUE
jsonschema: model URI and IRI formats
Sep 16, 2024
The JSON Schema specification allows for modeling resource identifiers, such as
URIs
andIRIs
, using theformat
keyword to specify that astring
is of a specific type (e.g., uri, iri, uuid).For example, in JSON Schema, this can be defined as follows:
To the best of my understanding, CUE does not directly support the
URI
orIRI
string formats as part of its standard types. What is the recommended approach or best practice in CUE for modeling such formats?The text was updated successfully, but these errors were encountered: