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

Where's the ServiceDescriptionLoader/AbstractConfigLoader? #68

Closed
webbj74 opened this issue Feb 2, 2015 · 3 comments
Closed

Where's the ServiceDescriptionLoader/AbstractConfigLoader? #68

webbj74 opened this issue Feb 2, 2015 · 3 comments

Comments

@webbj74
Copy link

webbj74 commented Feb 2, 2015

I'm trying to upgrade from guzzle/service 3.x and noticed that ServiceDescription class has been removed. I've seen #15 and #18 regarding the upgrade path. However, the new Description class in guzzle/guzzle-services lacks support for the JSDL "includes" parameter (formerly handled by AbstractConfigLoader). With Guzzle3 the JSDL abstraction was absolutely critical to make the JSON files maintainable (especially to set default "errorResponses" parameter which AFAIK had to be set for each individual status code; see example below). Is there another package I should be referring to for this functionality?

e.g. MainServiceDesc.json:

    "includes": [
        "CommonModels.json"
    ],
    "operations": {
        "GetStuff": {
            "extends": "CommonServiceOperation",
            "uri": "stuff",
            "summary": "Display a list of stuff"
        },

and CommonModels.json:

{
    "name": "CommonModels",
    "apiVersion": "1.0",
    "description": "Common model and operations for the api",
    "operations": {
        "CommonServiceOperation": {
            "httpMethod": "GET",
            "errorResponses": [
                {
                    "code": 400,
                    "class": "My\\Api\\CustomResponseException"
                },
                {
                    "code": 401,
                    "class": "My\\Api\\CustomResponseException"
                },

References:

@mtdowling
Copy link
Member

This version of Guzzle' service descriptions just takes the input value as-is. Yeah, I would suggest trying to find another package that provide the JSDL style includes and using that along-side this package when resolving descriptions.

@webbj74
Copy link
Author

webbj74 commented Feb 3, 2015

I've whipped together a small project which adapts your JSDL loader classes from the 3.x guzzle/service into a standalone project: webbj74/jsdl-loader. This worked for my purposes with minimal changes.

It wasn't clear from your comment above if this feature was dropped intentionally or, you just haven't had a chance to port it to 5.x. If this is something you'd like back in the Guzzle 5.x family, let me know; I'm happy to submit a PR (it's your code after all!).

@mtdowling
Copy link
Member

@webbj74 Cool!

It wasn't clear from your comment above if this feature was dropped intentionally or, you just haven't had a chance to port it to 5.x.

This is something I intentionally dropped. I wanted to make the library a lot more focused on just serializing and parsing messages. I was hoping libs like yours would spring up and fill in any gaps. Thanks for doing that!

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