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

make an option to use title instead of property name if title is available #101

Open
zsolt-dev opened this issue Mar 10, 2019 · 0 comments

Comments

@zsolt-dev
Copy link

I am using ajv with ajv-i18n to localize validation messages, which is great.

Problem is on required properties, since it is using the property name in the message. Is it possible to use the title instead if available?

It would be benneficial even for english speaking users since instead of this:
should have required property 'firstName'
user would see this:
should have required property 'First Name'

Example schema with title

const registerJsonSchema = {
  type: 'object',
  properties: {
    firstName: { type: 'string', title: 'Meno', minLength: 2, maxLength: 20 },
    ...
  },
  required: ['firstName', ...],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants