Closed OscarMeier closed 4 years ago
Found it - the model per-blueprint-action overrides where not being merged correctly. Bugfix shortly.
:tada: This issue has been resolved in version 3.2.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@OscarMeier Let us know how you get on. Thanks for finding this.
@danielsharvey Thank you for the quick fix! The custom blueprint route documentation works as expected for the description and the summary. But I didn't figure out how to exclude an action. I tried to use the exclude
option:
* /add:
* exclude: true
*
* /populate:
* exclude: true
*/
I checked your code and found out that you just omit the exclude
property:https://github.com/theoomoregbee/sails-hook-swagger-generator/blob/c407361355f0a3c117b01459084647a1d41db1bf/lib/generators.ts#L418
But the blueprint action documentation does not get removed, right?
I would propose to keep the exclude
property in the clone and to add a condition below:
if (pathEntry.exclude) {
return;
}
@OscarMeier Let me look! It looks like I did not check the test data closely enough! (several changes had large effects and I must not have checked the test fixture closely enough).
Found and fixed. Merging now.
Note that the exclude
property is excluded as it is included within the swagger
content but not valid OpenAPI and so excluded from the generated output.
:tada: This issue has been resolved in version 3.2.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@OscarMeier Let us know how you get on.
@danielsharvey Thank you for resolving this issue! Everything works as expected.
I'm not able to customize the blueprint route documentation: Neither by adding swagger JSDoc nor by adding the swagger object to the model (api/models/Foo.js):
I dug into your code and found the referenced line. It's the line, where the paths get generated. The merged models contain the correct documentation (summary: 'Foo', description: 'Bar') but the models are not used in the
generatePaths()
function to override the blueprint templates. Did I overlook something or is this feature not implemented yet?https://github.com/theoomoregbee/sails-hook-swagger-generator/blob/eafbed4acfce945103cbf06b776e9be669942916/lib/swagger-doc.ts#L95