You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated code presently passes a strict operation ID to every
`StrictMiddlewareFunc` you have configured for a server. This is great
for writing auth-like middleware: you can have a unified function that
handles authorization on the *operational* level, and test it by itself.
This is not so great if you're forgetful (like the author of this MR)
and sometimes forget to write those tests... or to update your handler
function.
By generating a list of all operation handlers, we make it much easier
to write a test that asserts that some `StrictMiddlewareFunc` has proper
behavior for *all* operation IDs.
Copy file name to clipboardExpand all lines: configuration-schema.json
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,10 @@
64
64
"server-urls": {
65
65
"type": "boolean",
66
66
"description": "Generate types for the `Server` definitions' URLs, instead of needing to provide your own values"
67
+
},
68
+
"strict-operation-list": {
69
+
"type": "boolean",
70
+
"description": "Generate a var StrictOperationIDs []string containing the normalized operation name passed to every StrictMiddlewareFunc call. Makes it straightforward to write generic tests that assert a behaviour holds for every strict operation."
0 commit comments