Skip to content

Instantly share code, notes, and snippets.

@eduardszoecs
Created February 27, 2019 17:12
Show Gist options
  • Save eduardszoecs/9da84e3d51931a10b96191fb4e29c3d4 to your computer and use it in GitHub Desktop.
Save eduardszoecs/9da84e3d51931a10b96191fb4e29c3d4 to your computer and use it in GitHub Desktop.
library(tidyverse)
## Something ------------------------------------
pr <- plumber::plumb('api.R')
pr$run(port = 1234, swagger = function(pr, spec, ...) {
spec <- yaml::read_yaml('swagger.yml')
spec
})
openapi: 3.0.3
info:
description: >-
An API
version: 0.1.1.9000
title: "An API"
tags:
- name: "tag1"
description: "tag1"
paths:
/users:
get:
summary: "get endpoint"
tags:
- "tag1"
# - "tags2"
description: "an endpoint"
parameters:
- name: "parameter"
in: "query"
description: "a parameters"
required: false
schema:
type: "string"
responses:
"204":
description: "No match not found."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment