cancel
Showing results for 
Search instead for 
Did you mean: 

traverse/walk through Response schema

SOLVED
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
Highlighted
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 Technical Writer
________________________

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!

View solution in original post

5 REPLIES 5
Highlighted
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 Technical Writer
________________________

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!
Highlighted
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

Highlighted
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 Technical Writer
________________________

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!
Highlighted
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

Highlighted
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 Technical Writer
________________________

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!

View solution in original post