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

APIKit rejects string-typed query parameter values that begin with single or double quotes or @ #551

Open
jasonkaedingCGI opened this issue Jun 10, 2020 · 1 comment

Comments

@jasonkaedingCGI
Copy link

jasonkaedingCGI commented Jun 10, 2020

APIKit v1.3.9
Mule Runtime 4.2.2

I have defined an API in RAML 1.0 with the following snippet:

/test:
  get:
    queryParameters:
      name:
        description: search by name
        type: string
        required: false

When I issue calls to the API for query parameters with only leading single- or double-quotation marks then APIKit rejects with 400 Bad Request. If the quotation mark is terminated elsewhere in the string, it is accepted. If the quotation mark appears in the middle of the string without termination, it is accepted.

400 Bad Request examples:
/test?name=%27
/test?name=%27test
/test?name=%27%20test
/test?name="
/test?name="test
/test?name="%20test
/test?name=@
/test?name=@test
/test?name=@%20test

200 OK examples:
/test?name=who%27s%20there
/test?name=%27test%27
/test?name=John%20"Jimbo"%20Devereaux
/test?name="test"
/test?name=%27%20
/test?name=%27%20%20%20%20
/test?name="%20
/test?name="%20%20%20%20

The rejected message is:
Invalid value ''test' for query parameter name. Syntax error in the following text: 'test'

Stack trace points to org.mule.module.apikit.validation.attributes.QueryParameterValidator.validate(QueryParameterValidator.java:142)

@jasonkaedingCGI jasonkaedingCGI changed the title APIKit rejects string-typed query parameter values that begin with single or double quotes APIKit rejects string-typed query parameter values that begin with single or double quotes or @ Jun 24, 2020
@jasonkaedingCGI
Copy link
Author

We found that the @ character also causes the same issue. Updated with more good/bad examples

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

No branches or pull requests

1 participant