Skip to content

Commit 911dbb5

Browse files
danielsharveytheoomoregbee
authored andcommitted
feat(meta.swagger): Add support for model attribute meta.swagger
The `meta` attribute allows extensions to Sails Model attributes; add `meta.swagger` to allow Swagger documentation to be added to the OpenAPI.UpdatedSchema definition for the attribute.
1 parent 5129c8f commit 911dbb5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/generators.ts

+5
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ export const generateAttributeSchema = (attribute: Sails.AttributeDefinition): O
164164

165165
// note: required --> required[] (not here, needs to be done at model level)
166166

167+
// finally, overwrite in custom swagger
168+
if(ai.meta?.swagger) {
169+
assign(schema, omit(ai.meta.swagger, 'exclude'));
170+
}
171+
167172
return schema;
168173
}
169174

0 commit comments

Comments
 (0)