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

fix: iterate through content object properties #10617

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/cli/generators/openapi/spec-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ function buildMethodSpec(controllerSpec, op, options) {
const json = content && content['application/json'];
propSchema = json && json.schema;
if (propSchema == null && content) {
for (const m of content) {
propSchema = content[m].schema;
for (const contentProperty in content) {
propSchema = contentProperty.schema;
if (propSchema) break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ the syntax options shown below.
* @param dataset Name of the dataset. In this case, the default value is
oa_citations
* @param version Version of the dataset.
* @param page Page you would like to fetch.
* @returns The dataset api for the given version is found and it is accessible
to consume.
*/
Expand Down Expand Up @@ -361,6 +362,16 @@ to consume.
default: 'v1',
},
},
{
name: 'page',
in: 'query',
description: 'Page you would like to fetch.',
content: {
'*/*': {
type: 'string',
},
},
},
],
responses: {
'200': {
Expand Down Expand Up @@ -403,7 +414,16 @@ to consume.
type: 'string',
default: 'v1',
},
}) version: string): Promise<string> {
}) version: string, @param({
name: 'page',
in: 'query',
description: 'Page you would like to fetch.',
content: {
'*/*': {
type: 'string',
},
},
}) page: string | undefined): Promise<string> {
throw new Error('Not implemented');
}
}
Expand Down Expand Up @@ -530,6 +550,7 @@ the syntax options shown below.
* @param dataset Name of the dataset. In this case, the default value is
oa_citations
* @param version Version of the dataset.
* @param page Page you would like to fetch.
* @returns The dataset api for the given version is found and it is accessible
to consume.
*/
Expand Down Expand Up @@ -561,6 +582,16 @@ to consume.
default: 'v1',
},
},
{
name: 'page',
in: 'query',
description: 'Page you would like to fetch.',
content: {
'*/*': {
type: 'string',
},
},
},
],
responses: {
'200': {
Expand Down Expand Up @@ -603,7 +634,16 @@ to consume.
type: 'string',
default: 'v1',
},
}) version: string): Promise<string> {
}) version: string, @param({
name: 'page',
in: 'query',
description: 'Page you would like to fetch.',
content: {
'*/*': {
type: 'string',
},
},
}) page: string | undefined): Promise<string> {
throw new Error('Not implemented');
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/test/fixtures/openapi/3.0/uspto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ paths:
schema:
type: string
default: v1
- name: page
in: query
description: Page you would like to fetch.
content:
'*/*':
type: string
responses:
'200':
description: >-
Expand Down
Loading