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

How to require array of items #230

Open
akshare opened this issue Sep 13, 2024 · 0 comments
Open

How to require array of items #230

akshare opened this issue Sep 13, 2024 · 0 comments

Comments

@akshare
Copy link

akshare commented Sep 13, 2024

I need to check that file[] and title[] are not empty.

Once I set required, I get Body does not match schema for content-type \"multipart\/form-data\"
If i remove "required", upload works correctly.

requestBody:
  required: true
  content:
    multipart/form-data:
      schema:
        required:
          - 'file[]'
          - 'title[]'
        properties:
          'file[]':
            type: array
            items:
              type: string
              format: binary
          'title[]':
            type: array
            items:
              type: string
        type: object

I have also tried this, but same results as above.

requestBody:
  required: true
  content:
    multipart/form-data:
      schema:
        required:
          - 'file'
          - 'title'
        properties:
          'file':
            type: array
            items:
              type: string
              format: binary
          'title':
            type: array
            items:
              type: string
        type: object
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