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

Link formation should consider cases for string literal with spaces and encode them #58

Open
jrcastillo opened this issue Aug 16, 2016 · 4 comments

Comments

@jrcastillo
Copy link

I've encountered an issue when the links for a json object are created. The code I'm generating forms a json object with a value of:

{
  "payload" : {
    "data": {
        "id": "test for it",
        "type": "tests"
      }
  }
}

after passing this object through the mapper the expected link to be created should be encoded for urls like this:

{
    "data": {
        "id": "test for it",
    },
    "self": "/tests/test%20for%20it"
}

instead it is being created this way

{
    "data": {
        "id": "test for it"
    },
    "self": "/tests/test for it"
}

Is it the expected behavior ?

@jamesdixon
Copy link
Contributor

@jrcastillo the result makes sense as we aren't doing any URL encoding. That said, an id with spaces in it like the one your example shows seems a bit odd. Is there a specific reason for doing this?

@ShadowManu @chamini2 can either of you think of a good reason to add extra cycles to URL encode? I personally cannot at this moment.

@jrcastillo
Copy link
Author

Yes, we are using a primary key of bank module as the id which is a text.

@chamini2
Copy link
Collaborator

Well, the returned url should be escaped. It doesn't seem like a hard fix.

@jamesdixon
Copy link
Contributor

True - simple, trivial fix.

@jrcastillo, we'll add this as an enhancement. If you'd like to submit a PR, we'd be grateful!

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

No branches or pull requests

3 participants