-
Notifications
You must be signed in to change notification settings - Fork 92
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
What can I use to sample the headers I should expect from a server? #109
Comments
I thought about this before but forgot to implement it. I think it's a cool idea but it would likely be a breaking change so I'll have to schedule it accordingly. I'm going to be out of pocket until the 31st but I would love to talk about it more. |
The change does not have to be breaking. I would also suggest You may want to go as far as |
I'm sure we can do it in a non-breaking approach too. Thanks for the ideas. |
Since the next release of |
What can I use to sample the headers I should expect from a server?
The OpenApi spec allows definition of response headers.
I noted
sway.Response#getSample()
- which is cool - but it returns only body.Is there an API to sample the headers object?
Full story is bellow to whoever is interested.
Any ideas?
Thanks,
-- Osher
Full Story
I'm working on a code generator for a spec-first process where
1 - specs are written by architects,
2 - generator uses specs to generate a working project with configs, controllers, unit tests, e2e test, etc - all tests should pass.
3 - developers replace mock replies with real implementation without breaking tests (and may be required to add tests of their own to the provided structure).
Concerning the controller implementation part, my target is to render a function like the example bellow.
(The tests part will need to use the same information, so it's relevant for tests too)
So basically, I read the spec using
sway
on generation time and use a templating engine to get that done. Eventually architects and developers can replace values in the generated samples to make their case more concrete if they so wish.I'm cool with the
statusCode
, and with thebody
.What would you suggest me for handling the
headers
?The text was updated successfully, but these errors were encountered: