Yelp / bravado

Bravado is a python client library for Swagger 2.0 services
Other
602 stars 117 forks source link

Expose api to get the service `title` from the client #174

Open prat0318 opened 8 years ago

prat0318 commented 8 years ago

Swagger spec has a info.title attribute which gives the service name. This can be used to label the client call by title. There should be a way in bravado and swagger-py to get it.

prat0318 commented 8 years ago

"label the client call by title" was meant wrt zipkin. I should have mentioned that. It would be used in bravado decorators when wrapping with zipkin client. The wrapper needed a "service_name" to be labelled. Other than zipkin, it is more like a _good_tohave.

sanseihappa commented 4 years ago

How about?

client = SwaggerClient.from_url(example)
client.swagger_spec.client_spec_dict.get("info").get("title")