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

Update templates to make use of getModelSchemaRef #3204

Closed
5 tasks done
nabdelgadir opened this issue Jun 21, 2019 · 0 comments · Fixed by #3402
Closed
5 tasks done

Update templates to make use of getModelSchemaRef #3204

nabdelgadir opened this issue Jun 21, 2019 · 0 comments · Fixed by #3402
Assignees

Comments

@nabdelgadir
Copy link
Contributor

nabdelgadir commented Jun 21, 2019

Description / Steps to reproduce / Feature proposal

getModelSchemaRef was introduced as a helper for returning shared OpenAPI definitions. Now we can update our existing code to leverage it.

Sample usage:

class MyController {
  @get('/my', {
    responses: {
      '200': {
        description: 'Array of MyModel model instances',
        content: {
          'application/json': {
            schema: getModelSchemaRef(MyModel),
          },
        },
      },
    },
  })
  async find(): Promise<MyModel[]> {
    // etc.
  }
}

Acceptance Criteria

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

Successfully merging a pull request may close this issue.

2 participants