How to output OpenAPI spec with custom key need for advanced code generation features like security #3364
-
In my use case I would like to output OpenAPI spec but I am looking I would need for the output YAML file to contain extra key's that are hint's to the code generator that allow for advanced features in the generated code like support for SpringSecurity annotations in the web controller.
Thank you, kindly |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can use the |
Beta Was this translation helpful? Give feedback.
-
Is there a way to do this globally? We have a use case where we want to apply an extension to all operations and want to avoid writing the same decorator all over the place. |
Beta Was this translation helpful? Give feedback.
You can use the
@OpenAPI.extension
decorator from the@typespec/openapi
libraryhttps://typespec.io/playground?c=aW1wb3J0ICJAdHlwZXNwZWMvb3BlbmFwaSI7Cgp1c2luZyBPcGVuQVBJOwoKQGV4dGVuc2lvbigKICAieC1vcGVyYXRpb24tZXh0cmEtYW5ub3TFESIsCiAgWwogICAgIkBqYXZheC7KHS5zZWN1cml0eS5Sb2xlc0FsbG93ZWQoe1wiUk9MRV9URVNUXCJ9KcVExEBvcmcuc3ByaW5nZnJhbWV3b3JrykNhY2Nlc3PMXlPEG99Q31BzLnByZXBvc3QuUHJlQXV0aG9yaXplKFwiaGFz5AC0KCfJWicpIGFuZCDSGV9UV08nKVwiKSIKICBdCikKb3AgdGVzdCgpOiB2b2lkOwo%3D&e=%40typespec%2Fopenapi3&options=%7B%7D