This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { safeParse, safeStringify } from '@shared/utils-json'; | |
import { cache } from 'react'; | |
/** | |
* By default react cache only supports primitive arguments. | |
* | |
* This fn wraps react cache to support a single object argument. | |
*/ | |
export function safeCache<R>(fn: () => R): () => R; | |
export function safeCache<T, R>(fn: (p: T) => R): (p: T) => R; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
async activate() { | |
SL.graph.onDidChangeSourceNodeContent(({ node }) => { | |
if (!node || node.subtype !== 'md') return; | |
let diagnostics = []; | |
if (node.raw.match('swagger')) { | |
diagnostics = [ | |
{ | |
code: 'swagger-check', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "openapi-over-swagger", | |
"version": "0.0.1", | |
"main": "https://gist.githubusercontent.com/marbemac/99ca51fb1e871c888dc33b455240f08d/raw/c1b57e79aaa2e3ff655f7e9306cd13ffd3031977/plugin.js" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "1.0", | |
"title": "Giphy", | |
"description": "## Welcome\n\nThis is a place to put general notes and extra information, for internal use.\n\nTo get started designing/documenting this API, select a version on the left. # Title\nNo Description" | |
}, | |
"host": "api.giphy.com", | |
"basePath": "/v1", | |
"schemes": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "1.0", | |
"title": "To-do Demo", | |
"description": "## Welcome\n\nThis is a place to put general notes and extra information, for internal use.\n\nTo get started designing/documenting this API, select a version on the left. # Title\nNo Description" | |
}, | |
"host": "todos.stoplight.io", | |
"schemes": [ | |
"http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"flowVersion": "1.0", | |
"name": "To-do CRUD", | |
"description": "This scenario shows a test for a typical CRUD resource. \n\n1. You need to enter an apiKey variable of `123` below, otherwise steps will fail (try with and without it).\n2. Step 2 is purposefully setup to have a failing test, for demonstration purposes.", | |
"steps": [ | |
{ | |
"functions": [ | |
{ | |
"name": "Create It", | |
"input": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
swagger: '2.0' | |
info: | |
version: '1.0' | |
title: To-do Demo | |
description: |- | |
## Welcome | |
This is a place to put general notes and extra information, for internal use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: '2.0' | |
info: | |
version: 0.2.0 | |
title: VMware Cello | |
description: RESTful API for VMware Cello User Service | |
termsOfService: 'https://github.com/vmware/cello/blob/master/LICENSE' | |
license: | |
name: Apache 2.0 | |
url: 'https://github.com/vmware/cello/blob/master/LICENSE' | |
contact: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"steps": [ | |
{ | |
"functions": [ | |
{ | |
"input": { | |
"request": { | |
"postData": { | |
"text": "{\n \"foo\": \"bar\"\n}" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Random Github Gist", | |
"steps": [ | |
{ | |
"functions": [ | |
{ | |
"name": "List gists and save random id", | |
"input": { | |
"request": { | |
"method": "get", |
NewerOlder