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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update templates to make use of `getModelSchemaRef` #3402

Merged
merged 3 commits into from Jul 22, 2019

Conversation

@nabdelgadir
Copy link
Contributor

commented Jul 19, 2019

  • Update CLI templates to use getModelSchemaRef
  • Update examples and docs to use it too

Closes #3204.

Checklist

馃憠 Read and sign the CLA (Contributor License Agreement) 馃憟

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

馃憠 Check out how to submit a PR 馃憟

@nabdelgadir nabdelgadir requested review from bajtos and raymondfeng as code owners Jul 19, 2019

@nabdelgadir nabdelgadir self-assigned this Jul 19, 2019

@@ -4,6 +4,7 @@ import {
import {
param,
get,
getModelSchemaRef

This comment has been minimized.

Copy link
@raymondfeng

raymondfeng Jul 19, 2019

Member

It should be getModelSchemaRef,

@bajtos

bajtos approved these changes Jul 22, 2019

Copy link
Member

left a comment

Looks mostly good.

Please add the missing , as pointed out by Raymond and consider whether to address or ignore my comments below.

@@ -23,7 +24,7 @@ export class <%= controllerClassName %> {
description: '<%= targetModelClassName %> belonging to <%= sourceModelClassName %>',
content: {
'application/json': {
schema: { type: 'array', items: { 'x-ts-type': <%= targetModelClassName %> } },
schema: { type: 'array', items: getModelSchemaRef(<%= targetModelClassName %>) },

This comment has been minimized.

Copy link
@bajtos

bajtos Jul 22, 2019

Member

While we are touching this file & line, should we fix the white-space formatting too?

Suggested change
schema: { type: 'array', items: getModelSchemaRef(<%= targetModelClassName %>) },
schema: {type: 'array', items: getModelSchemaRef(<%= targetModelClassName %>)},
@@ -32,7 +32,7 @@ export class <%= controllerClassName %> {
description: 'Array of <%= targetModelClassName %>\'s belonging to <%= sourceModelClassName %>',
content: {
'application/json': {
schema: { type: 'array', items: { 'x-ts-type': <%= targetModelClassName %> } },
schema: { type: 'array', items: getModelSchemaRef(<%= targetModelClassName %>) },

This comment has been minimized.

Copy link
@bajtos

bajtos Jul 22, 2019

Member

Similarly here - should we fix the white-space formatting too?

Suggested change
schema: { type: 'array', items: getModelSchemaRef(<%= targetModelClassName %>) },
schema: {type: 'array', items: getModelSchemaRef(<%= targetModelClassName %>)},
@@ -49,7 +49,7 @@ export class <%= controllerClassName %> {
responses: {
'200': {
description: '<%= sourceModelClassName %> model instance',
content: { 'application/json': { schema: { 'x-ts-type': <%= targetModelClassName %> } } },
content: { 'application/json': { schema: getModelSchemaRef(<%= targetModelClassName %>) } },

This comment has been minimized.

Copy link
@bajtos

bajtos Jul 22, 2019

Member

Similarly here - should we fix the white-space formatting too?

Suggested change
content: { 'application/json': { schema: getModelSchemaRef(<%= targetModelClassName %>) } },
content: {'application/json': {schema: getModelSchemaRef(<%= targetModelClassName %>)}},
@bajtos bajtos referenced this pull request Jul 22, 2019
0 of 7 tasks complete

@nabdelgadir nabdelgadir force-pushed the get-model-schema-ref branch from 9cd2349 to a974191 Jul 22, 2019

@bajtos

bajtos approved these changes Jul 22, 2019

Copy link
Member

left a comment

馃憦

You may want to wait for @raymondfeng to approve too.

@nabdelgadir nabdelgadir merged commit 9f67921 into master Jul 22, 2019

4 checks passed

clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 91.526%
Details

@delete-merged-branch delete-merged-branch bot deleted the get-model-schema-ref branch Jul 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can鈥檛 perform that action at this time.