Ask a Question

traverse/walk through Response schema

SOLVED
pradeepnr
New Contributor

traverse/walk through Response schema

what library can I refer to traverse/walk through response schema of each Path?

5 REPLIES 5
HKosova
SmartBear Alumni (Retired)

Hi @pradeepnr,

 

You need an OpenAPI/Swagger parser. There are parsers for different programming languages, check out https://openapi.tools/#parsers.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

@HKosova, Thankyou very much for responding. I am aware of the parsers. With these parsers I will be able to parse the openAPI 3.0 doc. Is there any library that will use these parsers to traverse through the responses.

I want to traverse through the response structure to list all the attributes, sub-attributes, sub-sub-...attributes and so on.

 

Thanks,

Pradeep

HKosova
SmartBear Alumni (Retired)

Parsers should have methods to get the schema for a response. Once you have the response schema you will be able to traverse its properties.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

@HKosova Thank you for responding. Is there any library you are aware of for schema traversal?

I did find one schema walker. But it is for different draft.

 

Thanks,

Pradeep

HKosova
SmartBear Alumni (Retired)

Parsers themselves most likely have classes/interfaces that represent OpenAPI Schema Object and that could be used to read schema attributes and access sub-schemas.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: