Skip to content

Inconsistent behavior asking for non-existent columns #4

@antoniolucasnobar

Description

@antoniolucasnobar

Testing https://github.com/chicojfp/queryfier-sample ,
if I ask only columns that are not mapped in the filter, the server returns an Error, but the SELECT is fired to the database (bringing all the columns). Ex.:

http://localhost:8080/cities?c=president&c=governor

AliasToBeanTrasformer expects alias to convert to desired entity/DTO, but, in this case it gets any. QueryBuilder.java looks if the client asked for specific columns, and try map those to the projections.

However, if I request at least one valid column, Ex.:
http://localhost:8080/cities?c=name&c=president&c=governor

It brings only the valid(name) column. It looks inconsistent to me and could confuse the clients that would expects all the fields they requested.

My suggestion is to match the number of columns asked and the number of projections generated.

Question, should I look any other features for the same behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions