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 property title expansion optional #2

Merged
merged 15 commits into from
Feb 5, 2024
Merged

Conversation

ethanpmullen
Copy link
Collaborator

@ethanpmullen ethanpmullen commented Jan 31, 2024

This adds the option to make property title expansion optional, i.e. this schema:

export const input = {
  title: 'Example Schema',
  type: 'object',
  properties: {
    firstName: {
      title: 'First Name',
      type: 'string',
    },
    lastName: {
      title: 'Last Name',
      id: 'lastName',
      type: 'string',
    }
  },
  required: ['firstName', 'lastName'],
}

Will produce this type:

export interface ExampleSchema {
      firstName: string;
      lastName: string;
      [k: string]: unknown;
}

Instead of this type:

export type FirstName = string;

export type LastName = string;

export interface ExampleSchema {
      firstName: FirstName;
      lastName: LastName;
      [k: string]: unknown;
}

@ethanpmullen ethanpmullen changed the title Ignore titles option Make property title expansion optional Feb 1, 2024
README.md Outdated Show resolved Hide resolved
src/parser.ts Show resolved Hide resolved
@ethanpmullen ethanpmullen merged commit 5069060 into master Feb 5, 2024
1 check failed
@ethanpmullen ethanpmullen deleted the ignore-titles-option branch February 9, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants