Skip to content

Commit

Permalink
Merge pull request #3 from nfroidure/fix/jsdocs
Browse files Browse the repository at this point in the history
fix(jsdocs): fix JSDocs generation
  • Loading branch information
nfroidure authored Oct 2, 2020
2 parents e84d88e + 2a7ba53 commit 361e2e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1245,8 +1245,7 @@ async function updatePetWithForm(
* Deletes a pet
* @param {Object} parameters
* The parameters to provide (destructured)
* @param {string} [parameters.apiKey]
* undefined,
* @param {string} [parameters.apiKey],
* @param {integer} parameters.petId
* Pet id to delete
* @param {Object} options
Expand Down
22 changes: 18 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ ${operations
}${dereferencedParameters
.filter(
(p) =>
!['X-API-Version', 'X-SDK-Version', 'X-APP-Version'].includes(p.name),
!['X-API-Version', 'X-SDK-Version', 'X-Application-Version'].includes(
p.name,
),
)
.map(
(parameter) => `
Expand All @@ -118,12 +120,24 @@ ${operations
}),
),
].join('|')
: (parameter.schema as OpenAPIV3.NonArraySchemaObject).type
: ((parameter.schema as OpenAPIV3.ReferenceObject).$ref
? ($refs.get(
(parameter.schema as OpenAPIV3.ReferenceObject).$ref,
) as Exclude<typeof parameter.schema, OpenAPIV3.ReferenceObject>)
: ((parameter.schema as Exclude<
typeof parameter.schema,
OpenAPIV3.ReferenceObject
>) as OpenAPIV3.NonArraySchemaObject)
).type
: 'any'
}} ${parameter.required ? `` : `[`}parameters.${camelCase(parameter.name)}${
parameter.required ? `` : `]`
}
* ${parameter.description}`,
}${
parameter.description
? `
* ${parameter.description}`
: ''
}`,
)}
* @param {Object} options
* Options to override Axios request configuration
Expand Down

0 comments on commit 361e2e3

Please sign in to comment.