Skip to content

Commit

Permalink
Merge pull request #456 from maykinmedia/feature/453-remove-v1
Browse files Browse the repository at this point in the history
[#453] remove v1
  • Loading branch information
annashamray authored Sep 30, 2024
2 parents e9a69ef + 082a3fe commit 4266064
Show file tree
Hide file tree
Showing 29 changed files with 19 additions and 4,446 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 docs
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: objects.conf.ci

- name: Check for OAS changes
run: |
diff openapi-${{ matrix.version }}.yaml src/objects/api/${{ matrix.version }}/openapi.yaml
diff openapi.yaml src/objects/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/objects/api/${{ matrix.version }}/openapi.yaml -o ./tests/postman/collection.json --pretty
run: openapi2postmanv2 -s ./src/objects/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 SDKs

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/objects/api/${{ matrix.version }}/openapi.yaml
run: echo ::set-output name=oas::./src/objects/api/v2/openapi.yaml
- name: Validate schema
run: openapi-generator-cli validate -i ${{ steps.vars.outputs.oas }}
- name: Generate Java client
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/lint-oas.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: Lint OAS

steps:
- uses: actions/checkout@v4
Expand All @@ -27,4 +23,4 @@ jobs:
- name: Install spectral
run: npm install -g @stoplight/spectral@5
- name: Run OAS linter
run: spectral lint ./src/objects/api/${{ matrix.version }}/openapi.yaml
run: spectral lint ./src/objects/api/v2/openapi.yaml
14 changes: 0 additions & 14 deletions README.NL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,6 @@ latest n/a `ReDoc <https://redocly.github.io/redoc/?url=htt
2.0.0 2021-09-22 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/2.0.0/src/objects/api/v2/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/2.0.0/src/objects/api/v2/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objects-api/compare/1.2.0..2.0.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.3.0 2021-01-12 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.3.0/src/objects/api/v1/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.3.0/src/objects/api/v1/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objects-api/compare/1.2.0..1.3.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.2.0 2021-09-22 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.2.0/src/objects/api/v1/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.2.0/src/objects/api/v1/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objects-api/compare/1.1.1..1.2.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.1.1 2021-06-22 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.1.1/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.1.1/src/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objects-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/objects-api/1.1.0/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.1.0/src/openapi.yaml>`_
(`verschillen <https://github.com/maykinmedia/objects-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/objects-api/1.0.0/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.0.0/src/openapi.yaml>`_
============== ============== =============================

Vorige versies worden nog 6 maanden ondersteund nadat de volgende versie is uitgebracht.
Expand Down
14 changes: 0 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ latest n/a `ReDoc <https://redocly.github.io/redoc/?url=htt
2.0.0 2021-09-22 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/2.0.0/src/objects/api/v2/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/2.0.0/src/objects/api/v2/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objects-api/compare/1.2.0..2.0.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.3.0 2021-01-12 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.3.0/src/objects/api/v1/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.3.0/src/objects/api/v1/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objects-api/compare/1.2.0..1.3.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.2.0 2021-09-22 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.2.0/src/objects/api/v1/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.2.0/src/objects/api/v1/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objects-api/compare/1.1.1..1.2.0#diff-b9c28fec6c3f3fa5cff870d24601d6ab7027520f3b084cc767aefd258cb8c40a>`_)
1.1.1 2021-06-22 `ReDoc <https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.1.1/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.1.1/src/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objects-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/objects-api/1.1.0/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.1.0/src/openapi.yaml>`_
(`diff <https://github.com/maykinmedia/objects-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/objects-api/1.0.0/src/openapi.yaml>`_,
`Swagger <https://petstore.swagger.io/?url=https://raw.githubusercontent.com/maykinmedia/objects-api/1.0.0/src/openapi.yaml>`_
============== ============== =============================

Previous versions are supported for 6 month after the next version is released.
Expand Down
15 changes: 3 additions & 12 deletions bin/generate_schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@
#
# 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

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
export SCHEMA_PATH=src/objects/api/v2/openapi.yaml

export SCHEMA_PATH=src/objects/api/$1/openapi.yaml
OUTPUT_FILE=$1

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/objects/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("objects.api.v1.urls", namespace="v1")),
path("v2", include("objects.api.v2.urls", namespace="v2")),
]
Empty file removed src/objects/api/v1/__init__.py
Empty file.
121 changes: 0 additions & 121 deletions src/objects/api/v1/filters.py

This file was deleted.

Loading

0 comments on commit 4266064

Please sign in to comment.