-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support passing a %Reference{} as a response when doing controller specs #532
Support passing a %Reference{} as a response when doing controller specs #532
Conversation
@@ -27,6 +27,7 @@ defmodule OpenApiSpexTest.UserControllerAnnotated do | |||
}, | |||
unauthorized: Unauthorized.response(), | |||
not_found: NotFound.response(), | |||
unprocessable_entity: %Reference{"$ref": "#/components/responses/unprocessable_entity"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the referenced response defined? In the tests we should show how such references are mean to be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this? 0ccecab
@@ -27,6 +27,7 @@ defmodule OpenApiSpexTest.UserControllerAnnotated do | |||
}, | |||
unauthorized: Unauthorized.response(), | |||
not_found: NotFound.response(), | |||
unprocessable_entity: %Reference{"$ref": "#/components/responses/unprocessable_entity"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also update examples/phoenix_app
showing how this can be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? a3824e4
Hey @zorbash is anything holding this off? |
I tested this locally in some of my apps and seems to be working without issues. |
Fixes #530