Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Special characters in Strings #40

Closed
Burtan opened this issue Jan 7, 2017 · 20 comments
Closed

Special characters in Strings #40

Burtan opened this issue Jan 7, 2017 · 20 comments
Assignees

Comments

@Burtan
Copy link

Burtan commented Jan 7, 2017

Hi,
I've now upgrade to V2 and everything is compiling and running. Thank you for resolving the issues I had. I've now came across an issue with special characters in strings.
I've saved "König" in the datastore correctly but it is now transmitted as "K?nig". In V1 this was working fine. The same happens to É.

@Burtan
Copy link
Author

Burtan commented Jan 19, 2017

Any ideas?

@tangiel tangiel self-assigned this Jan 19, 2017
@tangiel
Copy link
Contributor

tangiel commented Jan 21, 2017

@Burtan what version are you running on? Does it still happen on 2.0.0 (final)? I am trying this on a method that simply echoes a request back and it seems to be fine.

$ curl -H "Content-Type: application/json" -X POST -d '{"message": "König"}' http://localhost:8080/_ah/api/echo/v1/echo
{
"message": "König"
}

@Burtan
Copy link
Author

Burtan commented Jan 21, 2017

Yes, it happens with 2.0.0. Is your test using a String as the return type? It happens for me using a class containing a String variable. Maybe that matters.

@tangiel
Copy link
Contributor

tangiel commented Jan 21, 2017

No, raw String isn't allowed as a return type in Endpoints. This is a Message class containing a String field. I will keep looking into it. If you can find a repro that doesn't involve datastore (or just nothing sensitive for you) then I'll be happy to take it. Thanks!

@Burtan
Copy link
Author

Burtan commented Jan 21, 2017

I'll look into it.

@Burtan
Copy link
Author

Burtan commented Jan 21, 2017

This problem has something to do with the openapi-doc file that is submitted to gcloud. I have created a new endpoints class with exactly the same code as the problematic endpoints class and the characters were transmitted correctly. Then I created a new openapi-doc and submitted it to gcloud/updated the entry in the appengine-web.xml file. This lead to the same error as in the original endpoints class.

@Burtan
Copy link
Author

Burtan commented Jan 21, 2017

This is a part of the problematic openapi-doc

  "/myApi/v1/chars": {
   "post": {
    "operationId": "MyApiGetRbRef",
    "parameters": [
     {
      "in": "body",
      "name": "body",
      "required": false,
      "schema": {
       "$ref": "#/definitions/RbRefRequest"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "A successful response",
      "schema": {
       "$ref": "#/definitions/RbRefResponse"
      }
     }
    },
    "security": [
     {
      "google_id_token": [ ]
     },
     {
      "google_id_token_https": [ ]
     }
    ],
    "x-security": [
     {
      "google_id_token": {
       "audiences": [
        "XXX.apps.googleusercontent.com"
       ]
      }
     },
     {
      "google_id_token_https": {
       "audiences": [
        "XXX.apps.googleusercontent.com"
       ]
      }
     }
    ]
   }
  }

@tangiel
Copy link
Contributor

tangiel commented Jan 21, 2017

Are the contents of your web.xml the same? I wonder if the GoogleAppEngineControlFilter is mangling the output somehow.

@Burtan
Copy link
Author

Burtan commented Jan 21, 2017

Yes, I didn't change web.xml

@tangiel
Copy link
Contributor

tangiel commented Jan 21, 2017

So let me restate it to see if I understand: If you add a new endpoint and use the old OpenAPI document, it works. If you upload a new OpenAPI document that includes the new endpoint, it breaks?

@Burtan
Copy link
Author

Burtan commented Jan 21, 2017

Yes, you got it right.

@tangiel
Copy link
Contributor

tangiel commented Jan 21, 2017

Thanks. This indicates an issue with the endpoints-management-java repo then, but it helps narrow it down a lot.

@tangiel
Copy link
Contributor

tangiel commented Jan 25, 2017

This should be fixed if you upgrade your endpoints-management dependency to 1.0.1.

@tangiel tangiel closed this as completed Jan 25, 2017
@patflynn
Copy link

patflynn commented Jan 26, 2017 via email

@tangiel
Copy link
Contributor

tangiel commented Jan 27, 2017

No, are you seeing issues with just the standard framework?

@patflynn
Copy link

patflynn commented Jan 27, 2017 via email

@tangiel
Copy link
Contributor

tangiel commented Jan 27, 2017

Can you paste a sample request?

@patflynn
Copy link

patflynn commented Jan 30, 2017 via email

@tangiel
Copy link
Contributor

tangiel commented Jan 30, 2017

Yes, and what is the special character you're not seeing correctly?

@patflynn
Copy link

patflynn commented Jan 30, 2017 via email

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

No branches or pull requests

3 participants