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

Documentation issue. #62

Open
jaznow opened this issue Jul 10, 2014 · 1 comment
Open

Documentation issue. #62

jaznow opened this issue Jul 10, 2014 · 1 comment

Comments

@jaznow
Copy link

jaznow commented Jul 10, 2014

Hi,

Just wanted to point out, that in your documentation:
https://github.com/misd-service-development/guzzle-bundle/blob/master/Resources/doc/serialization.md

You explain how you can define commands, and you say that you can put:
"GetPerson":{
"httpMethod":"GET",
"uri":"person/{id}",...

and so on.

But I couln't figure out, where should I put that on, and re-readed, and re-readed the documentacion, and still couldnt figure out, I've even asked on a IRC channel, but couldn't get any help.

It would be awesome that I could have this working, but can't follow the doc on this part (de serialization)

Thanks!

@alex-pex
Copy link

alex-pex commented Dec 2, 2014

Have you read the part on service description ? https://github.com/misd-service-development/guzzle-bundle/blob/master/Resources/doc/service.md

You must set a new service which is a bridge beetween Guzzle and a configuration file. Then you describe your WS in this file.

I use this definition on a project :

my_api.client:
        class: %guzzle.client.class%
        tags:
            - { name: guzzle.client }
        calls:
            - [ setBaseUrl,     [ %my_api.client.base_url% ] ]
            - [ setDescription, [ @my_api.service_description ] ]

    my_api.service_description:
        class: %guzzle.service_description.class%
        factory_class: %guzzle.service_description.class%
        factory_method: factory
        arguments: [ %my_api.client.service_description_path% ]

and my service description is something like this :

{
    "name": "MyAPI",
    "description": "MyAPI client",
    "operations": {
        "getPersons": {
            "httpMethod": "GET",
            "uri": "/api/persons.json",
            "additionalParameters": {
                "location": "query"
            },
            "responseClass":"ArrayCollection<Entity\\Person>"
        }
    }
}

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