Skip to content

Commit

Permalink
Merge b4f3a33 into 3f0869c
Browse files Browse the repository at this point in the history
  • Loading branch information
aaqilniz committed Apr 30, 2024
2 parents 3f0869c + b4f3a33 commit 2107f47
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 13 deletions.
3 changes: 2 additions & 1 deletion packages/cli/generators/openapi/spec-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ function buildMethodSpec(controllerSpec, op, options) {
methodParameters[methodName] = [];
if (parameters) {
parameters.forEach(param => {
methodParameters[methodName].push(param.name);
const {argName} = buildParameter(param, {});
methodParameters[methodName].push(argName);
});
}
if (op.spec.requestBody) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
addPet(params: { requestBody: NewPet }): Promise<Pet>;
addPet(params: { 'content-type': string; requestBody: NewPet }): Promise<Pet>;
/**
* Returns a user based on a single ID, if the user does not have access to the
Expand Down Expand Up @@ -271,10 +272,11 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
addPet(params: { requestBody: NewPet }): Promise<Pet>;
addPet(params: { 'content-type': string; requestBody: NewPet }): Promise<Pet>;
/**
* Returns a user based on a single ID, if the user does not have access to the
Expand Down Expand Up @@ -640,12 +642,22 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
*
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
@operation('post', '/pets', {
description: 'Creates a new pet in the store. Duplicates are allowed',
operationId: 'addPet',
parameters: [
{
name: 'content-type',
in: 'header',
schema: {
type: 'string',
},
},
],
requestBody: {
description: 'Pet to add to the store',
required: true,
Expand Down Expand Up @@ -680,7 +692,13 @@ pulvinar elit eu, euismod sapien.
},
},
})
async addPet(@requestBody({
async addPet(@param({
name: 'content-type',
in: 'header',
schema: {
type: 'string',
},
}) contentType: string | undefined, @requestBody({
description: 'Pet to add to the store',
required: true,
content: {
Expand All @@ -691,7 +709,7 @@ pulvinar elit eu, euismod sapien.
},
},
}) _requestBody: NewPet): Promise<Pet> {
return this.openApiService.addPet(_requestBody);
return this.openApiService.addPet(contentType, _requestBody);
}
/**
* Returns a user based on a single ID, if the user does not have access to the
Expand Down Expand Up @@ -919,10 +937,11 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
addPet(_requestBody: NewPet): Promise<Pet>;
addPet(contentType: string | undefined, _requestBody: NewPet): Promise<Pet>;
/**
* Returns a user based on a single ID, if the user does not have access to the
Expand Down Expand Up @@ -1278,12 +1297,22 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
*
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
@operation('post', '/pets', {
description: 'Creates a new pet in the store. Duplicates are allowed',
operationId: 'addPet',
parameters: [
{
name: 'content-type',
in: 'header',
schema: {
type: 'string',
},
},
],
requestBody: {
description: 'Pet to add to the store',
required: true,
Expand Down Expand Up @@ -1318,7 +1347,13 @@ pulvinar elit eu, euismod sapien.
},
},
})
async addPet(@requestBody({
async addPet(@param({
name: 'content-type',
in: 'header',
schema: {
type: 'string',
},
}) contentType: string | undefined, @requestBody({
description: 'Pet to add to the store',
required: true,
content: {
Expand Down Expand Up @@ -1670,10 +1705,11 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
addPet(_requestBody: NewPet): Promise<Pet>;
addPet(contentType: string | undefined, _requestBody: NewPet): Promise<Pet>;
/**
* Returns a user based on a single ID, if the user does not have access to the
Expand Down Expand Up @@ -2039,12 +2075,22 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
*
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
@operation('post', '/pets', {
description: 'Creates a new pet in the store. Duplicates are allowed',
operationId: 'addPet',
parameters: [
{
name: 'content-type',
in: 'header',
schema: {
type: 'string',
},
},
],
requestBody: {
description: 'Pet to add to the store',
required: true,
Expand Down Expand Up @@ -2079,7 +2125,13 @@ pulvinar elit eu, euismod sapien.
},
},
})
async addPet(@requestBody({
async addPet(@param({
name: 'content-type',
in: 'header',
schema: {
type: 'string',
},
}) contentType: string | undefined, @requestBody({
description: 'Pet to add to the store',
required: true,
content: {
Expand All @@ -2090,7 +2142,7 @@ pulvinar elit eu, euismod sapien.
},
},
}) _requestBody: NewPet): Promise<Pet> {
return this.openApiService.addPet(_requestBody);
return this.openApiService.addPet(contentType, _requestBody);
}
/**
* Returns a user based on a single ID, if the user does not have access to the
Expand Down Expand Up @@ -2318,10 +2370,11 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
addPet(_requestBody: NewPet): Promise<Pet>;
addPet(contentType: string | undefined, _requestBody: NewPet): Promise<Pet>;
/**
* Returns a user based on a single ID, if the user does not have access to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,22 @@ pulvinar elit eu, euismod sapien.
/**
* Creates a new pet in the store. Duplicates are allowed
*
* @param contentType
* @param _requestBody Pet to add to the store
* @returns pet response
*/
@operation('post', '/pets', {
description: 'Creates a new pet in the store. Duplicates are allowed',
operationId: 'addPet',
parameters: [
{
name: 'content-type',
in: 'header',
schema: {
type: 'string',
},
},
],
requestBody: {
description: 'Pet to add to the store',
required: true,
Expand Down Expand Up @@ -258,7 +268,13 @@ pulvinar elit eu, euismod sapien.
},
},
})
async addPet(@requestBody({
async addPet(@param({
name: 'content-type',
in: 'header',
schema: {
type: 'string',
},
}) contentType: string | undefined, @requestBody({
description: 'Pet to add to the store',
required: true,
content: {
Expand Down
Loading

0 comments on commit 2107f47

Please sign in to comment.