Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping between properties #6

Open
m-mohr opened this issue Jul 16, 2024 · 0 comments
Open

Mapping between properties #6

m-mohr opened this issue Jul 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@m-mohr
Copy link
Contributor

m-mohr commented Jul 16, 2024

We often see two fields that depend on each other, i.e. the value of one field depends on the other.

For example:

  • crop_id
  • crop_name

Can we validate that? For example through a map? Does it make things to complicated?

How would that work in JSON Schema? A discussion in their Slack lead to the conclusion that the only reasonable way is anyOf:

anyOf: [
  {properties: {name: {const: 1}, id: {const: "apple"}}},
  {properties: {name: {const: 2}, id: {const: "peach"}}},
  ...
]
@m-mohr m-mohr added the enhancement New feature or request label Jul 16, 2024
@m-mohr m-mohr added this to fiboa Jul 22, 2024
@github-project-automation github-project-automation bot moved this to Backlog in fiboa Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant