Skip to content

Commit

Permalink
Merge pull request #130 from maykinmedia/feature/remove-v1
Browse files Browse the repository at this point in the history
remove v1
  • Loading branch information
annashamray authored Oct 3, 2024
2 parents 52b7b40 + c416aeb commit e67ae79
Show file tree
Hide file tree
Showing 23 changed files with 20 additions and 1,450 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ jobs:
black --check src
oas-up-to-date:
name: Check for unexepected OAS changes
name: Check for unexpected OAS changes
runs-on: ubuntu-latest
strategy:
matrix:
version: ['v1', 'v2']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -60,18 +57,18 @@ jobs:
run: pip install -r requirements/ci.txt

- name: Generate OAS files
run: ./bin/generate_schema.sh ${{ matrix.version }} openapi-${{ matrix.version }}.yaml
run: ./bin/generate_schema.sh openapi.yaml
env:
DJANGO_SETTINGS_MODULE: objecttypes.conf.ci

- name: Check for OAS changes
run: |
diff openapi-${{ matrix.version }}.yaml src/objecttypes/api/${{ matrix.version }}/openapi.yaml
diff openapi.yaml src/objecttypes/api/v2/openapi.yaml
- name: Write failure markdown
if: ${{ failure() }}
run: |
echo 'Run the following command locally and commit the changes' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo './bin/generate_schema.sh ${{ matrix.version }}' >> $GITHUB_STEP_SUMMARY
echo './bin/generate_schema.sh' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
8 changes: 2 additions & 6 deletions .github/workflows/generate-postman-collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ on:
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1', 'v2' ]

name: Run with version ${{ matrix.version }}
name: Generate Postman collection

steps:
- uses: actions/checkout@v4
Expand All @@ -29,4 +25,4 @@ jobs:
- name: Create tests folder
run: mkdir -p ./tests/postman
- name: Generate Postman collection
run: openapi2postmanv2 -s ./src/objecttypes/api/${{ matrix.version }}/openapi.yaml -o ./tests/postman/collection.json --pretty
run: openapi2postmanv2 -s ./src/objecttypes/api/v2/openapi.yaml -o ./tests/postman/collection.json --pretty
8 changes: 2 additions & 6 deletions .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ on:
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1', 'v2' ]

name: Run with version ${{ matrix.version }}
name: Generate SDK

steps:
- uses: actions/checkout@v4
Expand All @@ -28,7 +24,7 @@ jobs:
run: npm install -g @openapitools/openapi-generator-cli
- name: Determing oas path
id: vars
run: echo ::set-output name=oas::./src/objecttypes/api/${{ matrix.version }}/openapi.yaml
run: echo ::set-output name=oas::./src/objecttypes/api/v2/openapi.yaml
- name: Validate schema
run: openapi-generator-cli validate -i ${{ steps.vars.outputs.oas }}
- name: Generate Java client
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/lint-oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ on:
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'v1', 'v2' ]

name: Run with version ${{ matrix.version }}

name: Lint OAS
steps:
- uses: actions/checkout@v4
- name: Use Node.js
Expand All @@ -27,4 +22,4 @@ jobs:
- name: Install spectral
run: npm install -g @stoplight/spectral@5
- name: Run OAS linter
run: spectral lint ./src/objecttypes/api/${{ matrix.version }}/openapi.yaml
run: spectral lint ./src/objecttypes/api/v2/openapi.yaml
11 changes: 0 additions & 11 deletions README.NL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,6 @@ latest n/a `ReDoc <https://redocly.github.io/redoc/?url=htt
2.0.0 2021-10-04 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/2.0.0/src/objecttypes/api/v2/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/2.0.0/src/objecttypes/api/v2/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objecttypes-api/compare/1.2.0..2.0.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.2.0 2022-06-24 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.2.0/src/objecttypes/api/v1/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.2.0/src/objecttypes/api/v1/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objecttypes-api/compare/1.1.1..1.2.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.1.1 2021-08-17 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.1.1/src/objecttypes/api/v1/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.1.1/src/objecttypes/api/v1/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objecttypes-api/compare/1.1.0..1.1.1#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.1.0 2021-04-21 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.1.0/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.1.0/src/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objecttypes-api/compare/1.0.0..1.1.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.0.0 2021-01-13 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.0.0/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.0.0/src/openapi.yaml>`_
============== ============== =============================

Vorige versies worden nog 6 maanden ondersteund nadat de volgende versie is uitgebracht.
Expand Down
11 changes: 0 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ latest n/a `ReDoc <https://redocly.github.io/redoc/?url=htt
2.0.0 2021-10-04 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/2.0.0/src/objecttypes/api/v2/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/2.0.0/src/objecttypes/api/v2/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objecttypes-api/compare/1.2.0..2.0.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.2.0 2022-06-24 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.2.0/src/objecttypes/api/v1/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.2.0/src/objecttypes/api/v1/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objecttypes-api/compare/1.1.1..1.2.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.1.1 2021-08-17 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.1.1/src/objecttypes/api/v1/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.1.1/src/objecttypes/api/v1/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objecttypes-api/compare/1.1.0..1.1.1#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.1.0 2021-04-21 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.1.0/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.1.0/src/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objecttypes-api/compare/1.0.0..1.1.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.0.0 2021-01-13 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.0.0/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objecttypes-api/1.0.0/src/openapi.yaml>`_
============== ============== =============================

Previous versions are supported for 6 month after the next version is released.
Expand Down
18 changes: 4 additions & 14 deletions bin/generate_schema.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
#!/bin/bash
#
# Dump the current OAS into YAML file src/objecttypes/api/<version>/openapi.yaml
# Dump the current OAS into YAML file src/objecttypes/api/v2/openapi.yaml
#
# Run this script from the root of the repository

if [ "$1" = "" ]; then
echo "You need to pass a version in the first argument"
exit 1
fi
export SCHEMA_PATH=src/objecttypes/api/v2/openapi.yaml

if [ "$1" != "v1" ] && [ "$1" != "v2" ]; then
echo "You need to pass a correct version in the first argument. Available values: v1, v2"
exit 1
fi
OUTPUT_FILE=$1

export SCHEMA_PATH=src/objecttypes/api/$1/openapi.yaml

OUTPUT_FILE=$2

src/manage.py spectacular --file ${OUTPUT_FILE:-$SCHEMA_PATH} --validate --api-version $1
src/manage.py spectacular --file ${OUTPUT_FILE:-$SCHEMA_PATH} --validate
1 change: 0 additions & 1 deletion src/objecttypes/api/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.urls import include, path

urlpatterns = [
path("v1", include("objecttypes.api.v1.urls", namespace="v1")),
path("v2", include("objecttypes.api.v2.urls", namespace="v2")),
]
Empty file removed src/objecttypes/api/v1/__init__.py
Empty file.
Loading

0 comments on commit e67ae79

Please sign in to comment.