Link formation should consider cases for string literal with spaces and encode them
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 ?
@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.
Yes, we are using a primary key of bank module as the id which is a text.
Well, the returned url should be escaped. It doesn't seem like a hard fix.
True - simple, trivial fix.
@jrcastillo, we'll add this as an enhancement. If you'd like to submit a PR, we'd be grateful!