cancel
Showing results for 
Search instead for 
Did you mean: 

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?

1 ACCEPTED SOLUTION

Accepted Solutions
HKosova
Moderator

Re: traverse/walk through Response schema

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. ⬇️⬇️⬇️

View solution in original post

5 REPLIES 5
HKosova
Moderator

Re: traverse/walk through Response schema

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. ⬇️⬇️⬇️
pradeepnr
New Contributor

Re: traverse/walk through Response schema

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

Re: traverse/walk through Response schema

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. ⬇️⬇️⬇️
pradeepnr
New Contributor

Re: traverse/walk through Response schema

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

Re: traverse/walk through Response schema

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. ⬇️⬇️⬇️

View solution in original post

New Here?
Join us and watch the welcome video: