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

create-value-parser "array" splits strings passed in body into characters #80

Open
sbgreene1307 opened this issue Oct 20, 2017 · 1 comment

Comments

@sbgreene1307
Copy link

sbgreene1307 commented Oct 20, 2017

With schema parameters like:

parameters:
      - in: "body"
        name: "body"
        description: "JSON array of words to add to the corpus"
        required: true
        schema:
          type: "object"
          required: 
          - words
          properties:
            words:
              type: "array"
              items:
                type: "string"

Sending a request like:

{"words":"foobar"}

The create-value-parser "array" will use the string value "foobar" since body is the first value in path. The subsequent map function applies the items-parser to each character of the string.

I would expect just the word "foobar" to be parsed since the default split array would be a csv split.

@sbgreene1307 sbgreene1307 changed the title create-value-parser "array" needs to properly validate the value create-value-parser "array" splits strings passed in body into characters Oct 31, 2017
@sbgreene1307
Copy link
Author

What is the point of allowing for a comma separated string to be parsed as an array?

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