Skip to content

Commit

Permalink
Validate swagger.yaml (fiatconnect#41)
Browse files Browse the repository at this point in the history
* test(ci): validate swagger.yaml

* test(ci): prevent duplicate runs on merge

* feat: add cli validation

* fix: remove gitIgnore and add newline to workflow

* fix: add .gitignore

* fix: remove unneeded fields from package.json
  • Loading branch information
MuckT authored May 17, 2022
1 parent 85580ab commit 709f297
Show file tree
Hide file tree
Showing 4 changed files with 480 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/validate-swagger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
pull_request:
branches:
- main
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Validate Swagger.yaml'

jobs:
validate_swagger:
runs-on: ubuntu-latest
name: Validate Swagger
steps:
- uses: actions/checkout@v2
- name: Validate OpenAPI definition
run: yarn validate
127 changes: 127 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "specification",
"version": "0.0.1",
"description": "FiatConnect API Specification",
"repository": "https://github.com/fiatconnect/specification.git",
"scripts": {
"validate": "yarn swagger-cli validate swagger.yaml"
},
"devDependencies": {
"@apidevtools/swagger-cli": "^4.0.4"
}
}
Loading

0 comments on commit 709f297

Please sign in to comment.