Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
How to get a list of possible JSON Schema format values to use in REACT application?

We are developing a REACT application that needs to get a list of the JSON schema standard built-in formats. According to json-schema.org reference page the built-in formats are as follows:

  • Dates and times
  • Email addresses
  • Hostnames
  • IP Addresses
  • etc.

I'd rather if I didn't have to hardcode those values in our application, so how can we retrieve a list of those possible values programmatically?

[EDIT]

A clarification, we are developing a JSON schema that sets "$schema": "http://json-schema.org/schema". This is how the app would be able to identify that we are using the current JSON Schema specification. From there we are looking for a way to load possible values for "format" so we can present it in the UI.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

$schema indicates the version of the specification that the schema that declares it is using.

Each version of the specification declares a (small) static set of available formats.

It's not unreasonable to hardcode these sets into a lookup by $schema value. There are only 4 or 5 (if you include draft 4) values for this keyword, unless you're writing your own meta-schemas.

I've hardcoded them into my JSON Schema library, JsonSchema.Net.


If you're looking for an automated way to find these values, you're going to have to scan the specification documents themselves. They're not listed in the meta-schemas, which is what you get when you navigate to the URI (not a URL) find in $schema. The meta-schema just requires that format's value is a string.

The specification intentionally leaves this open-ended so that people can create their own custom formats.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda