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

Refactor metaToJsonProperty to accept AJV keywords #2684

Closed
iqbaldjulfri opened this issue Apr 3, 2019 · 4 comments
Closed

Refactor metaToJsonProperty to accept AJV keywords #2684

iqbaldjulfri opened this issue Apr 3, 2019 · 4 comments
Assignees

Comments

@iqbaldjulfri
Copy link
Contributor

Description

We need to add additional attributes (AJV keywords) from PropertyDefinition so they will be written to openapi.json and we can use it as validation. Currently, only type, description, items (for arrays), and $ref are written (and a hard-coded format: 'date-time' for Date instances).

Current Behavior

@model()
export class Employee extends Entity {
  @property({
    type: 'string',
    required: true,
    format: 'email', // this won't be written to openapi.json
  })
  email: string;

  @property({
    type: 'string',
    required: true,
    pattern: '(staff|manager|director)', // this also won't be written to openapi spec
  })
  type: string;
}

Expected Behavior

Other AJV keywords is written to openapi spec

@iqbaldjulfri
Copy link
Contributor Author

#2685 this is the pull request for this issue

@dhmlau
Copy link
Member

dhmlau commented Apr 4, 2019

@iqbaldjulfri, let me assign this issue to you since you have a PR up.

@bajtos
Copy link
Member

bajtos commented Apr 5, 2019

I feel this is a duplicate of #1624

@iqbaldjulfri
Copy link
Contributor Author

the solution has been merged in #2685 .

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

No branches or pull requests

3 participants