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

/info endpoint missing semicolon in field urlPart #8

Open
erikw opened this issue Sep 29, 2017 · 2 comments · May be fixed by #10
Open

/info endpoint missing semicolon in field urlPart #8

erikw opened this issue Sep 29, 2017 · 2 comments · May be fixed by #10

Comments

@erikw
Copy link
Contributor

erikw commented Sep 29, 2017

The GET ..../info print out is wrong for the return field urlPart, missing first semicolon between ID section and first filter section.

Setup

There is a standard resource, say BookResource, which we can call GET on using restler.

How to trigger the bug

Do an HTTP call to retrieve by ID ("-" does not trigger this bug), and with at least one segment filter

GET /books/1;publisher=2;id__ne=3/info

Look at the return body:

{   
   ... 
   "urlPart": "1id <>=3;publisher=2",
   ...
}

See now that there is a missing semicolon ";" between the ID and the first segment filter id <>=... After the second one, all semicolons are included as they should

This is annoying of course as it makes it harder to read this debug info.

Where the problem comes from

In restdsl.queries.ServiceQuery.toUrlPart() the code only adds the first semicolon if the ID section is the "-" match all. Otherwise it forgets to add the first semicolon.

Possible solution

Add a first semicolon in all cases when criteria is not null.

@mithunsasidharan
Copy link

@erikw : can I pick this up ?

@erikw
Copy link
Contributor Author

erikw commented Sep 30, 2017

Yeah :)

erikw pushed a commit that referenced this issue Nov 24, 2017
Always append ; as separator between ID-part and criteria-part for info
query URL part.

Fixes #8
@erikw erikw linked a pull request Nov 24, 2017 that will close this issue
@erikw erikw closed this as completed Mar 16, 2021
@erikw erikw reopened this Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants