Skip to content

Update method and query_method to pass endpoints.ResourceContainer rather than Message #79

Closed
sstriker opened this Issue Oct 2, 2013 · 12 comments

7 participants

@sstriker
sstriker commented Oct 2, 2013

Since recent GAE releases the following warning shows up:

WARNING  2013-10-02 15:39:49,077 api_config.py:1771] Method specifies path parameters but you are not using a ResourceContainer. This will fail in future releases; please switch to using ResourceContainer as soon as possible.

EndpointsModel.method and EndpointsModel.query_method set request_message, these should wrap the ProtoModel() in an endpoints.ResourceContainer.

@dhermes
Google Cloud Platform member
dhermes commented Oct 2, 2013

Maybe @kdeus or @danholevoet could have a look at this.

Getting endpoints.ResourceContainer was one of my last efforts before leaving, I hope you like the change (it was needed to really adhere to the spec).

@sstriker I'm happy to review any changes if you'd like to take a stab as well.

@kdeus
kdeus commented Oct 3, 2013

The warning is happening because one of your method's paths refers to a parameter in the request message. While a possible workaround is to specify request_message=... with a ResourceContainer, that pretty much defeats the purpose of the endpoints-proto-datastore library.

We could have endpoints-proto-datastore recognize path parameters and automatically create a ResourceContainer to wrap them... But we could just as easily do the same thing in the core Endpoints library, and I'm drawing a blank as to why we didn't do that in the first place. @dhermes, do you remember?

@Scarygami

@sstriker the now merged pull request #80 should resolve all those warnings without any changes necessary in your code. Can you check if it works correctly for you?

@onimitch

Works OK for me.

@sstriker

@Scarygami Indeed seems to work correctly for me; no more warnings.

@douglascorrea

I'm still receiving warnings with Development SDK 1.8.9

@kayef
kayef commented Sep 8, 2014

Hi,

I am still getting the below error running GAE 1.9.1

WARNING  2014-09-08 05:58:31,542 api_config.py:1785] Method erpmcs.salesorders.update specifies path parameters but you are not using a ResourceContainer. This will fail in future releases; please switch to using ResourceContainer as soon as possible.

My method is as below:

@SalesOrder.method(request_message=SalesOrder.ProtoModel(), path='salesorders/{id}',
        http_method='PUT', name='salesorders.update')
    def SalesOrderUpdate(self, salesOrder_request):
        return SalesOrder.UpdateSalesOrderFromProto(salesOrder_request)
@dhermes
Google Cloud Platform member
dhermes commented Sep 8, 2014

@kayef which version of this library are you using? What is the commit hash of HEAD?

@kayef
kayef commented Sep 8, 2014

@dhermes I'm not sure. I downloaded the whole endpoints-proto-datastore folder some time back.

How do I check the version?

@dhermes
Google Cloud Platform member
dhermes commented Sep 8, 2014

According to
https://code.google.com/p/endpoints-proto-datastore/downloads/detail?name=endpoints_proto_datastore.zip&can=2&q=#makechanges
The zip was last updated at commit a261da0 while this bug was filed two months after that commit.

Try updating your copy of endpoints-proto-datastore by cloning this repo and using the most recent commit.

@dhermes dhermes closed this Sep 8, 2014
@kayef
kayef commented Sep 9, 2014

@dhermes I have updated to the latest one and the commit is:

d38b90d

But I'm still getting the same warning.

What else can I do?

@dhermes
Google Cloud Platform member
dhermes commented Sep 10, 2014

Can you make sure you are importing the new version and not the old one. You can do this in the dev server by opening the Interactive Console and typing

import endpoints_proto_datastore
print endpoints_proto_datastore.__file__

to make sure it's coming from the right place.

If the issue persists:

  1. Open a new issue
  2. Include a working app that causes the issue (no need to send your real app if it is private, just narrow down to the issue).
  3. Detail if it occurs in production/dev or both.
  4. Include the actual warnings/errors from the logs.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.