Skip to content

/info endpoint missing semicolon in field urlPart #8

@erikw

Description

@erikw

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions