Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda