Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!