Trax-air / swagger-tester

Automatically test your swagger API
MIT License
105 stars 36 forks source link

Add Support for Custom Headers #14

Closed zdelagrange closed 8 years ago

zdelagrange commented 8 years ago

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.

cyprieng commented 8 years ago

Yes that's indeed a good idea.

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

flavianh commented 8 years ago

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

cyprieng commented 8 years ago

@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 ?

zdelagrange commented 8 years ago

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.

flavianh commented 8 years ago

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.