Skip to content

Instantly share code, notes, and snippets.

@develohpanda
Last active May 4, 2020 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save develohpanda/0127e63fab0fa72e8eaefa076061bd15 to your computer and use it in GitHub Desktop.
Save develohpanda/0127e63fab0fa72e8eaefa076061bd15 to your computer and use it in GitHub Desktop.
Import via clipboard into Insomnia, and note the folders, requests, default Content-Type header, and environments created
openapi: 3.0.0
info:
version: 1.0.2
title: Example
tags:
- name: folder one # converted to folders
- name: folder two
servers:
- url: https://petstore.swagger.io/v2 # converted to scheme, host, base_path env variables
paths:
/pet:
post: # operation
tags:
- folder one # add to folder
summary: Add a new pet to the store # request name
operationId: addPet # should be unique
parameters:
- in: header
name: Content-Type
schema:
type: string
default: application/json # https://swagger.io/docs/specification/media-types/
required: true # enabled by default
put:
tags:
- folder one
summary: Update an existing pet
operationId: updatePet # should be unique
parameters:
- in: header
name: Content-Type
schema:
type: string
default: text/html
required: true
/pet/findByStatus:
get:
tags:
- folder two
summary: Finds Pets by status
description: Multiple status values can be provided with comma separated strings
operationId: findPetsByStatus # should be unique
parameters:
- name: status
in: query
description: Status values that need to be considered for filter
required: true
explode: true
schema:
type: array
items:
type: string
enum:
- available
- pending
- sold
default: available
"/pet/{variable}":
get:
tags:
- folder two
summary: Query with variable
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth: # https://swagger.io/docs/specification/authentication/bearer-authentication/
type: http
scheme: bearer
@develohpanda
Copy link
Author

develohpanda commented May 4, 2020

Folder, name, Content-Type header
image

Insomnia currently doesn't handle the bearerToken definition correctly (bottom, v7.1.1), but in the next release (top), it will add an environment variable for the token.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment