Skip to content

Instantly share code, notes, and snippets.

View ponelat's full-sized avatar

Josh Ponelat ponelat

View GitHub Profile
@ponelat
ponelat / pathItems
Last active September 1, 2023 10:32
PathItems
openapi: 3.1.0
info:
title: Example specification
version: "1.0"
servers:
- url: http://localhost:8080/
paths:
/foo:
$ref: "#/components/pathItems/StandardStatus"
/bar:
@ponelat
ponelat / swagger-editor-cdn.html
Created March 2, 2023 15:55
Swagger Editor standalone html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="SwaggerEditor"
/>
<title>SwaggerEditor</title>
openapi: 3.1.0
info:
title: OpenAPI
version: '1.0.0'
description: OpenAPI 3.1
paths: {}
@ponelat
ponelat / markdown.md
Created January 12, 2023 10:19
Largish Markdown for examples

OpenAPI Specification

Version 3.1.0

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 RFC2119 RFC8174 when, and only when, they appear in all capitals, as shown here.

This document is licensed under The Apache License, Version 2.0.

Introduction

@ponelat
ponelat / README.md
Last active August 11, 2022 17:14
Remove tags

How to use:

# You may need to update the links in the gists to work.
curl -sNL https://gist.githubusercontent.com/ponelat/2ce2e23090c9c42dfd3d296de8573ccd/raw/8bb3ea588fc8545c80d492a6da3979490d2ad996/overlay.yml | npx overlays-cli@latest

Note: requires Node 16+

See: https://github.com/ponelat/overlays-cli

@ponelat
ponelat / overlay.yml
Created August 11, 2022 08:24
Sample overlay
overlays: 1.0.0
extends: https://petstore3.swagger.io/api/v3/openapi.json
actions:
- target: '$.paths'
remove: true
- target: '$.components'
remove: true
- target: '$.info'
update:
title: Overlayed!
@ponelat
ponelat / asyncapi.yml
Created July 8, 2022 13:10
Example AsyncAPI with multiple messages using oneOf
asyncapi: '2.4.0'
info:
title: Multiple messages
version: '1.0.0'
channels:
some-channel:
publish:
message:
@ponelat
ponelat / one-of-not-handling-refs.aas.yml
Created June 20, 2022 12:53
oneOf rule false positive
asyncapi: '2.4.0'
info:
title: oneOf error
version: '1.0.0'
description: |
Weird oneOf error. Even though definition is good.
channels: {}
@ponelat
ponelat / missing-local-ref.aas.yml
Created June 20, 2022 11:45
Missing local $ref
asyncapi: '2.4.0'
info:
title: Error - Missing local $ref not showing error.
version: '1.0.0'
description: |
Missing a local $ref
channels:
adoptions.request:
@ponelat
ponelat / bad-indentation.aas.yml
Created June 20, 2022 11:21
Includes a badly indented schema
asyncapi: '2.4.0'
info:
title: Bad indentation
version: '1.0.0'
description: |
Bad indentation blows up validation panel
channels: {}