Skip to content

feat(schema): Add support for the 'format' keyword on string options #3

@ioncakephper

Description

@ioncakephper

Is your feature request related to a problem?

JSON Schema provides the format keyword to validate common string patterns like email, uri, date, etc. Our
cli.schema.json should explicitly allow and demonstrate this powerful feature for string-based arguments and
options. This makes the schema more robust.

Describe the solution you'd like

Tasks:

  1. In schema/cli.schema.json, locate the definitions for string properties within options and arguments.
  2. Ensure the format keyword is a valid property for any property of type: 'string'.
  3. In the examples/demo-init.yml file, add a new option to an existing command that uses a format, for
    example:

1 - name: --admin-email
2 type: string
3 description: The administrator's email address.
4 format: email
4. Add a test case to test/validate.test.js to confirm that validation correctly passes with a valid email and
fails with an invalid one for this new example.

Describe alternatives you've considered

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersschemarelated to managing schema

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions