Trax-air/swagger-tester

Add Support for Custom Headers

Closed this issue · 5 comments

Some applications may require custom headers for their requests.

I'm not sure how this should be implemented. My first inclination is to have an kwarg for swagger_tester that should be a list of tuples. If I don't have any feedback i will try to implement this later today.

Yes that's indeed a good idea.

Just to clarify, you are talking about headers parameters that doesn't appear in the swagger spec ?

Actually this is defined in the swagger spec here. Do we have support for this?

@traxair yes, but we don't support it yet. And I was wondering if there is any situation where the tester would need header which shouldn't appear in the spec ?

I was looking at the openAPI spec for the header. I'm not sure if that's the right place for my specific header just yet. I'll discuss with my team to see what we want, but from a openAPI spec & contract driven development standpoint, if the api requires a specific header it should be included in the spec, which makes me think this feature shouldn't be included.

So we should just add support for custom headers described in the contract, it does not make sense to do contract-driven development and have a special case for your headers if the spec allows it.