Yelp / bravado-core

Other
109 stars 98 forks source link

add fallback http client for spec resolution as jsonschema requires it #390

Closed benbariteau closed 1 year ago

benbariteau commented 1 year ago

This is kind of a doozy. Basically at some point jsonschema changed some behavior where it will now use the remote resolver logic to get remote jsonschema draft meta-specs. The old logic wouldn't actually work without an http client, which was not required to be set on a Spec object. This adds a default client object.

The client object itself is a little strange, because the docstring for the Spec type specifies that it should be a bravado.http_client.HttpClient. However, depending on that would lead to a circular dependency and untangling that is a lot of work. Instead, I made the most basic type which satisfies the minimal requirements for making this functional, which means creating the BasicHTTPClient and BasicHTTPFuture types.