Skip to content

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

Open
@zsolt-dev

Description

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', ...],
};

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      make an option to use title instead of property name if title is available · Issue #101 · ajv-validator/ajv-i18n