0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

swagger で CSV get/put を自分はこう書いた話 にゃ (正しいとは言っていない)

Last updated at Posted at 2019-02-15

schema の書き方がわからないから雑にやったった

api:
  parameters:
    - xxxx
  get
    summary: csv download
    description: |
      xxxx
  response:
    200:
      description: |
        OK

        * col1  integer   xxxxx
        * col2  string  xxxxx
        * col3  integer   xxxxx

        Example)
        100,Bob,200
        200,Max,10
        300,Tom,4400
    400:
      $ref: '#/common/error'
  put
    summary: csv upload
    description: |
      xxxx
    parameters:
      - name: body
        in: body
        required: true
        description: |
          OK 

          * col1  integer   xxxxx
          * col2  string  xxxxx
          * col3  integer   xxxxx

          Example)
          100,Bob,200
          200,Max,10
          300,Tom,4400
        schema:
          text/csv:
            schema:
              type: string
    responses:
      200:
        description: OK 
      400:
        $ref: '#/common/CsvBadRequest'

Gist

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?