Skip to content

Commit

Permalink
Add spectral action for openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
francbartoli committed Feb 19, 2024
1 parent 93aecba commit 8078435
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 29 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Validate OpenAPI with Spectral

on:
- push
- pull_request

jobs:
build:
name: Run Spectral
runs-on: ubuntu-latest
steps:
# Check out the repository
- name: Check out the repository
uses: actions/[email protected]

- name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: "3.10"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
poetry --version
# Run Spectral
- name: Run Spectral
uses: stoplightio/spectral-action@latest
with:
file_glob: 'pygeoapi-openapi.json'
1 change: 1 addition & 0 deletions .spectral.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends: ["spectral:oas"]
70 changes: 70 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
site_name: fastgeoapi
docs_dir: docs
site_dir: docs_build/site
theme:
name: material
features:
- navigation.tabs
- navigation.sections
- toc.integrate
- navigation.top
- search.suggest
- search.highlight
- content.tabs.link
- content.code.annotation
- content.code.copy
language: en
palette:
- scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to Dark Mode
primary: green
accent: red
- scheme: slate
toggle:
icon: material/toggle-switch
name: Switch to Light Mode
primary: green
accent: blue grey
icon:
admonition:
note: octicons/tag-16
abstract: octicons/checklist-16
info: octicons/info-16
tip: octicons/squirrel-16
success: octicons/check-16
question: octicons/question-16
warning: octicons/alert-16
failure: octicons/x-circle-16
danger: octicons/zap-16
bug: octicons/bug-16
example: octicons/beaker-16
quote: octicons/quote-16
plugins:
- termynal:
prompt_literal_start:
- "$"
extra:
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/geobeyond
- icon: fontawesome/brands/twitter
link: https://twitter.com/geobeyond
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/company/geobeyond

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- admonition
- pymdownx.arithmatex:
generic: true
- footnotes
- pymdownx.details
- pymdownx.superfences
- pymdownx.mark
- attr_list
- pymdownx.emoji

copyright: |
&copy; Copyright 2024 <a href="https://github.com/geobeyond">Geobeyond team</a>.
73 changes: 44 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ pydantic-settings = "^2.1.0"
authlib = "^1.3.0"
cachetools = "^5.3.2"
json-ref-dict = "^0.7.2"
mkdocs-material = "^9.5.9"
termynal = "^0.12.0"

[tool.poetry.scripts]
fastgeoapi = "cli:app"
Expand Down Expand Up @@ -71,6 +73,7 @@ mypy = "^1.5.0"
commitizen = "^3.6.0"
fencer = "^0.3.6"
# jsonref = "^1.1.0"
openapi-resolver = "^0.0.6"

[tool.coverage.paths]
source = [".", "*/site-packages"]
Expand Down

0 comments on commit 8078435

Please sign in to comment.