Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

short explanation of use #1

Closed
ppollet73 opened this issue Oct 29, 2013 · 1 comment
Closed

short explanation of use #1

ppollet73 opened this issue Oct 29, 2013 · 1 comment

Comments

@ppollet73
Copy link

Hello,
I'm very interested in using your php swagger-parser, however i do not know how to start, could you please publish a short example ?

Thanks in advance

Pierre

@TheFrozenFire
Copy link
Owner

Hi Pierre,

This library is still in very active development, and although I'm confident that it's roughly stable at this point, I'd suggest considering other tools unless you need to do very fine-tuned parsing of Swagger JSON.

That being said, you should be able to load a resource listing by simply passing its JSON to a Swagger\ResourceListing in its constructor (e.g. new Swagger\ResourceListing($json) ). For individual API declarations, you can do the same, with the API declaration JSON as a parameter.

Beyond that, you should simply be able to call each getter to navigate through the hierarchy of the JSON.

Let me know if you're confused, or if there are specific features you need in the parser. By and large, I'm aiming to keep the library simple, so that it does nothing more than parse the JSON input, and allow you to spit the state back out into a JSON string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants