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

Question: use enum values in custom error message #149

Open
targhs opened this issue Mar 3, 2023 · 0 comments
Open

Question: use enum values in custom error message #149

targhs opened this issue Mar 3, 2023 · 0 comments

Comments

@targhs
Copy link

targhs commented Mar 3, 2023

I have the following schema

const shared_schema = {
  $id: "shared_schema",
  title: "Shared Allowed Values",
  definitions: {
    routes: {
      enum: ["R1", "R2", "R3"],
      errorMessage: "Route must be a TOC-specified allowed value: R1, R2, R3"
    }
  }
};

Is there any way i could have all the enum values defined for routes inside my errorMessage? As i don't want to write all the enum values again and again. May be something like using a json pointer ${/definitions/routes/enum}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant