From 7e97084f1fa47281633c5ee907cf1165b6ac3387 Mon Sep 17 00:00:00 2001 From: Anna Shamray Date: Thu, 26 Sep 2024 15:15:40 +0200 Subject: [PATCH 1/3] :fire: [https://github.com/maykinmedia/objects-api/issues/453] remove v1 endpoints --- .github/workflows/code-quality.yml | 11 +- .../workflows/generate-postman-collection.yml | 8 +- .github/workflows/generate-sdks.yml | 8 +- .github/workflows/lint-oas.yml | 9 +- README.NL.rst | 11 - README.rst | 11 - bin/generate_schema.sh | 18 +- src/objecttypes/api/urls.py | 1 - src/objecttypes/api/v1/__init__.py | 0 src/objecttypes/api/v1/openapi.yaml | 780 ------------------ src/objecttypes/api/v1/urls.py | 44 - src/objecttypes/api/v1/views.py | 62 -- src/objecttypes/api/v2/openapi.yaml | 4 +- src/objecttypes/conf/api.py | 10 +- src/objecttypes/tests/v1/__init__.py | 0 src/objecttypes/tests/v1/test_auth.py | 40 - src/objecttypes/tests/v1/test_filters.py | 34 - .../tests/v1/test_objecttype_api.py | 145 ---- .../tests/v1/test_objectversion_api.py | 116 --- src/objecttypes/tests/v1/test_schema.py | 10 - src/objecttypes/tests/v1/test_validation.py | 120 --- src/objecttypes/tests/v1/utils.py | 13 - src/objecttypes/utils/hooks.py | 13 - 23 files changed, 19 insertions(+), 1449 deletions(-) delete mode 100644 src/objecttypes/api/v1/__init__.py delete mode 100644 src/objecttypes/api/v1/openapi.yaml delete mode 100644 src/objecttypes/api/v1/urls.py delete mode 100644 src/objecttypes/api/v1/views.py delete mode 100644 src/objecttypes/tests/v1/__init__.py delete mode 100644 src/objecttypes/tests/v1/test_auth.py delete mode 100644 src/objecttypes/tests/v1/test_filters.py delete mode 100644 src/objecttypes/tests/v1/test_objecttype_api.py delete mode 100644 src/objecttypes/tests/v1/test_objectversion_api.py delete mode 100644 src/objecttypes/tests/v1/test_schema.py delete mode 100644 src/objecttypes/tests/v1/test_validation.py delete mode 100644 src/objecttypes/tests/v1/utils.py delete mode 100644 src/objecttypes/utils/hooks.py diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index af75f82b..4364b671 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -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 @@ -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 diff --git a/.github/workflows/generate-postman-collection.yml b/.github/workflows/generate-postman-collection.yml index 7aa8d6f8..080b73d9 100644 --- a/.github/workflows/generate-postman-collection.yml +++ b/.github/workflows/generate-postman-collection.yml @@ -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 @@ -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 diff --git a/.github/workflows/generate-sdks.yml b/.github/workflows/generate-sdks.yml index 7109e0de..9753f333 100644 --- a/.github/workflows/generate-sdks.yml +++ b/.github/workflows/generate-sdks.yml @@ -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 @@ -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 diff --git a/.github/workflows/lint-oas.yml b/.github/workflows/lint-oas.yml index d9749b55..4a867c8b 100644 --- a/.github/workflows/lint-oas.yml +++ b/.github/workflows/lint-oas.yml @@ -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 @@ -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 diff --git a/README.NL.rst b/README.NL.rst index ab13a378..64d70bf1 100644 --- a/README.NL.rst +++ b/README.NL.rst @@ -46,17 +46,6 @@ latest n/a `ReDoc `_, `Swagger `_ (`verschillen `_) -1.2.0 2022-06-24 `ReDoc `_, - `Swagger `_ - (`verschillen `_) -1.1.1 2021-08-17 `ReDoc `_, - `Swagger `_ - (`verschillen `_) -1.1.0 2021-04-21 `ReDoc `_, - `Swagger `_ - (`verschillen `_) -1.0.0 2021-01-13 `ReDoc `_, - `Swagger `_ ============== ============== ============================= Vorige versies worden nog 6 maanden ondersteund nadat de volgende versie is uitgebracht. diff --git a/README.rst b/README.rst index 29c7bd73..79ef3bac 100644 --- a/README.rst +++ b/README.rst @@ -45,17 +45,6 @@ latest n/a `ReDoc `_, `Swagger `_ (`diff `_) -1.2.0 2022-06-24 `ReDoc `_, - `Swagger `_ - (`diff `_) -1.1.1 2021-08-17 `ReDoc `_, - `Swagger `_ - (`diff `_) -1.1.0 2021-04-21 `ReDoc `_, - `Swagger `_ - (`diff `_) -1.0.0 2021-01-13 `ReDoc `_, - `Swagger `_ ============== ============== ============================= Previous versions are supported for 6 month after the next version is released. diff --git a/bin/generate_schema.sh b/bin/generate_schema.sh index fcd3f592..cdb81a67 100755 --- a/bin/generate_schema.sh +++ b/bin/generate_schema.sh @@ -1,21 +1,11 @@ #!/bin/bash # -# Dump the current OAS into YAML file src/objecttypes/api//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 diff --git a/src/objecttypes/api/urls.py b/src/objecttypes/api/urls.py index b2e175ca..f69e4e09 100644 --- a/src/objecttypes/api/urls.py +++ b/src/objecttypes/api/urls.py @@ -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")), ] diff --git a/src/objecttypes/api/v1/__init__.py b/src/objecttypes/api/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/objecttypes/api/v1/openapi.yaml b/src/objecttypes/api/v1/openapi.yaml deleted file mode 100644 index b3787fa6..00000000 --- a/src/objecttypes/api/v1/openapi.yaml +++ /dev/null @@ -1,780 +0,0 @@ -openapi: 3.0.3 -info: - title: Objecttypes API - version: 1.2.0 (v1) - description: |+ - An API to manage Object types. - - # Introduction - - An OBJECTTYPE represents a collection of objects of similar form and/or function. - An OBJECTTYPE includes a definition of an object, represented as a JSON schema, and - metadata attributes. Metadata is stored on the top level and the JSON schema itself is stored - in VERSIONs because the definition of an object can change over time. - - ## Versions - - Over time, an OBJECTTYPE can also change. This is reflected with VERSIONs. - - A VERSION contains the JSON schema of an OBJECTTYPE at a certain time. Each - OBJECTTYPE can have several VERSIONs. A VERSION can have the `status` "draft" or "published". - Only draft VERSIONs are allowed to be changed. Once a VERSION is published - it becomes immutable, and if changes are still required a new VERSION should be created. - - ## JSON schema validation - - OBJECTTYPEs are created to ensure that OBJECTs in the Objects API have the same - well defined structure. The JSON schema makes this possible. - The Objects API retrieves the related OBJECTTYPE and validates the object data against - the JSON schema in the appropriate VERSION of the OBJECTTYPE. - - **Useful links** - - * [JSON schema](https://json-schema.org/) - - contact: - url: https://github.com/maykinmedia/objecttypes-api - license: - name: EUPL-1.2 -paths: - /objecttypes: - get: - operationId: objecttype_list - parameters: - - in: query - name: dataClassification - schema: - type: string - enum: - - confidential - - intern - - open - - strictly_confidential - description: |- - Confidential level of the object type - - * `open` - Open - * `intern` - Intern - * `confidential` - Confidential - * `strictly_confidential` - Strictly confidential - tags: - - Objecttypes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ObjectType' - description: OK - post: - operationId: objecttype_create - parameters: - - in: header - name: Content-Type - schema: - type: string - enum: - - application/json - description: Content type of the request body. - required: true - tags: - - Objecttypes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectType' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectType' - description: Created - /objecttypes/{objecttype_uuid}/versions: - get: - operationId: objectversion_list - parameters: - - in: path - name: objecttype_uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - tags: - - Objecttypes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ObjectVersion' - description: OK - post: - operationId: objectversion_create - parameters: - - in: header - name: Content-Type - schema: - type: string - enum: - - application/json - description: Content type of the request body. - required: true - - in: path - name: objecttype_uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - tags: - - Objecttypes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectVersion' - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectVersion' - description: Created - /objecttypes/{objecttype_uuid}/versions/{version}: - get: - operationId: objectversion_read - parameters: - - in: path - name: objecttype_uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - - in: path - name: version - schema: - type: integer - maximum: 32767 - minimum: 0 - description: Integer version of the OBJECTTYPE - required: true - tags: - - Objecttypes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectVersion' - description: OK - put: - operationId: objectversion_update - parameters: - - in: header - name: Content-Type - schema: - type: string - enum: - - application/json - description: Content type of the request body. - required: true - - in: path - name: objecttype_uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - - in: path - name: version - schema: - type: integer - maximum: 32767 - minimum: 0 - description: Integer version of the OBJECTTYPE - required: true - tags: - - Objecttypes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectVersion' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectVersion' - description: OK - patch: - operationId: objectversion_partial_update - parameters: - - in: header - name: Content-Type - schema: - type: string - enum: - - application/json - description: Content type of the request body. - required: true - - in: path - name: objecttype_uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - - in: path - name: version - schema: - type: integer - maximum: 32767 - minimum: 0 - description: Integer version of the OBJECTTYPE - required: true - tags: - - Objecttypes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedObjectVersion' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectVersion' - description: OK - delete: - operationId: objectversion_delete - parameters: - - in: path - name: objecttype_uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - - in: path - name: version - schema: - type: integer - maximum: 32767 - minimum: 0 - description: Integer version of the OBJECTTYPE - required: true - tags: - - Objecttypes - security: - - tokenAuth: [] - responses: - '204': - description: No response body - /objecttypes/{uuid}: - get: - operationId: objecttype_read - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - tags: - - Objecttypes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectType' - description: OK - put: - operationId: objecttype_update - parameters: - - in: header - name: Content-Type - schema: - type: string - enum: - - application/json - description: Content type of the request body. - required: true - - in: path - name: uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - tags: - - Objecttypes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectType' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectType' - description: OK - patch: - operationId: objecttype_partial_update - parameters: - - in: header - name: Content-Type - schema: - type: string - enum: - - application/json - description: Content type of the request body. - required: true - - in: path - name: uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - tags: - - Objecttypes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedObjectType' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ObjectType' - description: OK - delete: - operationId: objecttype_delete - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - description: Unique identifier (UUID4) - required: true - tags: - - Objecttypes - security: - - tokenAuth: [] - responses: - '204': - description: No response body -components: - schemas: - DataClassificationEnum: - enum: - - open - - intern - - confidential - - strictly_confidential - type: string - description: |- - * `open` - Open - * `intern` - Intern - * `confidential` - Confidential - * `strictly_confidential` - Strictly confidential - ObjectType: - type: object - properties: - url: - type: string - format: uri - minLength: 1 - maxLength: 1000 - description: URL reference to this object. This is the unique identification - and location of this object. - readOnly: true - uuid: - type: string - format: uuid - description: Unique identifier (UUID4) - name: - type: string - description: Name of the object type - maxLength: 100 - namePlural: - type: string - description: Plural name of the object type - maxLength: 100 - description: - type: string - description: The description of the object type - maxLength: 1000 - dataClassification: - allOf: - - $ref: '#/components/schemas/DataClassificationEnum' - description: |- - Confidential level of the object type - - * `open` - Open - * `intern` - Intern - * `confidential` - Confidential - * `strictly_confidential` - Strictly confidential - maintainerOrganization: - type: string - description: Organization which is responsible for the object type - maxLength: 200 - maintainerDepartment: - type: string - description: Business department which is responsible for the object type - maxLength: 200 - contactPerson: - type: string - description: Name of the person in the organization who can provide information - about the object type - maxLength: 200 - contactEmail: - type: string - description: Email of the person in the organization who can provide information - about the object type - maxLength: 200 - source: - type: string - description: Name of the system from which the object type originates - maxLength: 200 - updateFrequency: - allOf: - - $ref: '#/components/schemas/UpdateFrequencyEnum' - description: |- - Indicates how often the object type is updated - - * `real_time` - Real-time - * `hourly` - Hourly - * `daily` - Daily - * `weekly` - Weekly - * `monthly` - Monthly - * `yearly` - Yearly - * `unknown` - Unknown - providerOrganization: - type: string - description: Organization which is responsible for publication of the object - type - maxLength: 200 - documentationUrl: - type: string - format: uri - description: Link to the documentation for the object type - maxLength: 200 - labels: - description: Key-value pairs of keywords related for the object type - createdAt: - type: string - format: date - readOnly: true - description: Date when the object type was created - modifiedAt: - type: string - format: date - readOnly: true - description: Last date when the object type was modified - allowGeometry: - type: boolean - description: 'Shows whether the related objects can have geographic coordinates. - If the value is ''false'' the related objects are not allowed to have - coordinates and the creation/update of objects with `geometry` property - will raise an error ' - versions: - type: array - items: - type: string - format: uri - readOnly: true - description: list of URLs for the OBJECTTYPE versions - required: - - name - - namePlural - ObjectVersion: - type: object - description: |- - A type of `ModelSerializer` that uses hyperlinked relationships with compound keys instead - of primary key relationships. Specifically: - - * A 'url' field is included instead of the 'id' field. - * Relationships to other instances are hyperlinks, instead of primary keys. - - NOTE: this only works with DRF 3.1.0 and above. - properties: - url: - type: string - format: uri - readOnly: true - version: - type: integer - readOnly: true - description: Integer version of the OBJECTTYPE - objectType: - type: string - format: uri - readOnly: true - status: - allOf: - - $ref: '#/components/schemas/StatusEnum' - description: |- - Status of the object type version - - * `published` - Published - * `draft` - Draft - * `deprecated` - Deprecated - jsonSchema: - title: JSON schema - description: JSON schema for Object validation - createdAt: - type: string - format: date - readOnly: true - description: Date when the version was created - modifiedAt: - type: string - format: date - readOnly: true - description: Last date when the version was modified - publishedAt: - type: string - format: date - readOnly: true - nullable: true - title: Published_at - description: Date when the version was published - PatchedObjectType: - type: object - properties: - url: - type: string - format: uri - minLength: 1 - maxLength: 1000 - description: URL reference to this object. This is the unique identification - and location of this object. - readOnly: true - uuid: - type: string - format: uuid - description: Unique identifier (UUID4) - name: - type: string - description: Name of the object type - maxLength: 100 - namePlural: - type: string - description: Plural name of the object type - maxLength: 100 - description: - type: string - description: The description of the object type - maxLength: 1000 - dataClassification: - allOf: - - $ref: '#/components/schemas/DataClassificationEnum' - description: |- - Confidential level of the object type - - * `open` - Open - * `intern` - Intern - * `confidential` - Confidential - * `strictly_confidential` - Strictly confidential - maintainerOrganization: - type: string - description: Organization which is responsible for the object type - maxLength: 200 - maintainerDepartment: - type: string - description: Business department which is responsible for the object type - maxLength: 200 - contactPerson: - type: string - description: Name of the person in the organization who can provide information - about the object type - maxLength: 200 - contactEmail: - type: string - description: Email of the person in the organization who can provide information - about the object type - maxLength: 200 - source: - type: string - description: Name of the system from which the object type originates - maxLength: 200 - updateFrequency: - allOf: - - $ref: '#/components/schemas/UpdateFrequencyEnum' - description: |- - Indicates how often the object type is updated - - * `real_time` - Real-time - * `hourly` - Hourly - * `daily` - Daily - * `weekly` - Weekly - * `monthly` - Monthly - * `yearly` - Yearly - * `unknown` - Unknown - providerOrganization: - type: string - description: Organization which is responsible for publication of the object - type - maxLength: 200 - documentationUrl: - type: string - format: uri - description: Link to the documentation for the object type - maxLength: 200 - labels: - description: Key-value pairs of keywords related for the object type - createdAt: - type: string - format: date - readOnly: true - description: Date when the object type was created - modifiedAt: - type: string - format: date - readOnly: true - description: Last date when the object type was modified - allowGeometry: - type: boolean - description: 'Shows whether the related objects can have geographic coordinates. - If the value is ''false'' the related objects are not allowed to have - coordinates and the creation/update of objects with `geometry` property - will raise an error ' - versions: - type: array - items: - type: string - format: uri - readOnly: true - description: list of URLs for the OBJECTTYPE versions - PatchedObjectVersion: - type: object - description: |- - A type of `ModelSerializer` that uses hyperlinked relationships with compound keys instead - of primary key relationships. Specifically: - - * A 'url' field is included instead of the 'id' field. - * Relationships to other instances are hyperlinks, instead of primary keys. - - NOTE: this only works with DRF 3.1.0 and above. - properties: - url: - type: string - format: uri - readOnly: true - version: - type: integer - readOnly: true - description: Integer version of the OBJECTTYPE - objectType: - type: string - format: uri - readOnly: true - status: - allOf: - - $ref: '#/components/schemas/StatusEnum' - description: |- - Status of the object type version - - * `published` - Published - * `draft` - Draft - * `deprecated` - Deprecated - jsonSchema: - title: JSON schema - description: JSON schema for Object validation - createdAt: - type: string - format: date - readOnly: true - description: Date when the version was created - modifiedAt: - type: string - format: date - readOnly: true - description: Last date when the version was modified - publishedAt: - type: string - format: date - readOnly: true - nullable: true - title: Published_at - description: Date when the version was published - StatusEnum: - enum: - - published - - draft - - deprecated - type: string - description: |- - * `published` - Published - * `draft` - Draft - * `deprecated` - Deprecated - UpdateFrequencyEnum: - enum: - - real_time - - hourly - - daily - - weekly - - monthly - - yearly - - unknown - type: string - description: |- - * `real_time` - Real-time - * `hourly` - Hourly - * `daily` - Daily - * `weekly` - Weekly - * `monthly` - Monthly - * `yearly` - Yearly - * `unknown` - Unknown - securitySchemes: - tokenAuth: - type: apiKey - in: header - name: Authorization - description: Token-based authentication with required prefix "Token" -tags: -- name: Objecttypes -externalDocs: - url: https://objects-and-objecttypes-api.readthedocs.io/ -servers: -- url: /api/v1 diff --git a/src/objecttypes/api/v1/urls.py b/src/objecttypes/api/v1/urls.py deleted file mode 100644 index cf131b99..00000000 --- a/src/objecttypes/api/v1/urls.py +++ /dev/null @@ -1,44 +0,0 @@ -from django.urls import include, path - -from drf_spectacular.views import ( - SpectacularJSONAPIView, - SpectacularRedocView, - SpectacularYAMLAPIView, -) -from vng_api_common import routers - -from .views import ObjectTypeViewSet, ObjectVersionViewSet - -router = routers.DefaultRouter() -router.register( - r"objecttypes", - ObjectTypeViewSet, - [routers.nested("versions", ObjectVersionViewSet)], -) - - -app_name = "v1" - -urlpatterns = [ - path("", SpectacularJSONAPIView.as_view(), name="schema-json"), - path( - "/", - include( - [ - # schema - path( - "schema/openapi.yaml", - SpectacularYAMLAPIView.as_view(), - name="schema", - ), - path( - "schema/", - SpectacularRedocView.as_view(url_name="schema"), - name="schema-redoc", - ), - # actual endpoints - path("", include(router.urls)), - ] - ), - ), -] diff --git a/src/objecttypes/api/v1/views.py b/src/objecttypes/api/v1/views.py deleted file mode 100644 index ee659cb5..00000000 --- a/src/objecttypes/api/v1/views.py +++ /dev/null @@ -1,62 +0,0 @@ -from django.utils.translation import gettext_lazy as _ - -from drf_spectacular.utils import extend_schema, extend_schema_view -from rest_framework import viewsets -from rest_framework.exceptions import ValidationError -from rest_framework.settings import api_settings - -from objecttypes.core.constants import ObjectVersionStatus -from objecttypes.core.models import ObjectType, ObjectVersion - -from ..filters import ObjectTypeFilterSet -from ..mixins import NestedViewSetMixin -from ..serializers import ObjectTypeSerializer, ObjectVersionSerializer - - -@extend_schema_view( - retrieve=extend_schema(operation_id="objecttype_read"), - destroy=extend_schema(operation_id="objecttype_delete"), -) -class ObjectTypeViewSet(viewsets.ModelViewSet): - queryset = ObjectType.objects.prefetch_related("versions").order_by("-pk") - serializer_class = ObjectTypeSerializer - lookup_field = "uuid" - filterset_class = ObjectTypeFilterSet - - def perform_destroy(self, instance): - if instance.versions.exists(): - raise ValidationError( - { - api_settings.NON_FIELD_ERRORS_KEY: [ - _( - "All related versions should be destroyed before destroying the objecttype" - ) - ] - }, - code="pending-versions", - ) - - super().perform_destroy(instance) - - -@extend_schema_view( - retrieve=extend_schema(operation_id="objectversion_read"), - destroy=extend_schema(operation_id="objectversion_delete"), -) -class ObjectVersionViewSet(NestedViewSetMixin, viewsets.ModelViewSet): - queryset = ObjectVersion.objects.order_by("object_type", "-version") - serializer_class = ObjectVersionSerializer - lookup_field = "version" - - def perform_destroy(self, instance): - if instance.status != ObjectVersionStatus.draft: - raise ValidationError( - { - api_settings.NON_FIELD_ERRORS_KEY: [ - _("Only draft versions can be destroyed") - ] - }, - code="non-draft-version-destroy", - ) - - super().perform_destroy(instance) diff --git a/src/objecttypes/api/v2/openapi.yaml b/src/objecttypes/api/v2/openapi.yaml index 4ee10b48..7f847740 100644 --- a/src/objecttypes/api/v2/openapi.yaml +++ b/src/objecttypes/api/v2/openapi.yaml @@ -838,9 +838,9 @@ components: in: header name: Authorization description: Token-based authentication with required prefix "Token" +servers: +- url: /api/v2 tags: - name: Objecttypes externalDocs: url: https://objects-and-objecttypes-api.readthedocs.io/ -servers: -- url: /api/v2 diff --git a/src/objecttypes/conf/api.py b/src/objecttypes/conf/api.py index f3a3993f..7fb4ab63 100644 --- a/src/objecttypes/conf/api.py +++ b/src/objecttypes/conf/api.py @@ -1,7 +1,6 @@ from vng_api_common.conf.api import * # noqa - imports white-listed API_VERSION = "2.2.2" -VERSIONS = {"v1": "1.2.0", "v2": "2.2.2"} # api settings @@ -18,7 +17,7 @@ ], "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning", "DEFAULT_VERSION": "v2", # NOT to be confused with API_VERSION - it's the major version part - "ALLOWED_VERSIONS": ("v1", "v2"), + "ALLOWED_VERSIONS": ("v2",), "VERSION_PARAM": "version", # test "TEST_REQUEST_DEFAULT_FORMAT": "json", @@ -69,15 +68,12 @@ "EXTERNAL_DOCS": { "url": "https://objects-and-objecttypes-api.readthedocs.io/", }, - "VERSION": None, + "VERSION": API_VERSION, "GET_MOCK_REQUEST": "objecttypes.utils.autoschema.build_mock_request", "COMPONENT_NO_READ_ONLY_REQUIRED": True, "POSTPROCESSING_HOOKS": [ "drf_spectacular.hooks.postprocess_schema_enums", - "objecttypes.utils.hooks.postprocess_servers", - "objecttypes.utils.hooks.postprocess_versions", ], "TAGS": [{"name": "Objecttypes"}], + "SERVERS": [{"url": "/api/v2"}] } - -OAS_SERVERS = {"v1": [{"url": "/api/v1"}], "v2": [{"url": "/api/v2"}]} diff --git a/src/objecttypes/tests/v1/__init__.py b/src/objecttypes/tests/v1/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/src/objecttypes/tests/v1/test_auth.py b/src/objecttypes/tests/v1/test_auth.py deleted file mode 100644 index 47aac43a..00000000 --- a/src/objecttypes/tests/v1/test_auth.py +++ /dev/null @@ -1,40 +0,0 @@ -from rest_framework import status -from rest_framework.test import APITestCase - -from objecttypes.core.tests.factories import ObjectTypeFactory -from objecttypes.token.models import TokenAuth - -from .utils import reverse - - -class AuthTests(APITestCase): - def setUp(self) -> None: - object_type = ObjectTypeFactory.create() - self.urls = [ - reverse("objecttype-list"), - reverse("objecttype-detail", args=[object_type.uuid]), - ] - - def test_non_auth(self): - for url in self.urls: - with self.subTest(url=url): - response = self.client.get(url) - self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) - - def test_invalid_token(self): - TokenAuth.objects.create(contact_person="John Smith", email="smith@bomen.nl") - for url in self.urls: - with self.subTest(url=url): - response = self.client.get(url, HTTP_AUTHORIZATION=f"Token 12345") - self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) - - def test_valid_token(self): - token_auth = TokenAuth.objects.create( - contact_person="John Smith", email="smith@bomen.nl" - ) - for url in self.urls: - with self.subTest(url=url): - response = self.client.get( - url, HTTP_AUTHORIZATION=f"Token {token_auth.token}" - ) - self.assertEqual(response.status_code, status.HTTP_200_OK) diff --git a/src/objecttypes/tests/v1/test_filters.py b/src/objecttypes/tests/v1/test_filters.py deleted file mode 100644 index 5bf13191..00000000 --- a/src/objecttypes/tests/v1/test_filters.py +++ /dev/null @@ -1,34 +0,0 @@ -from rest_framework import status -from rest_framework.test import APITestCase - -from objecttypes.core.constants import DataClassificationChoices -from objecttypes.core.tests.factories import ObjectTypeFactory -from objecttypes.utils.test import TokenAuthMixin - -from .utils import reverse, reverse_lazy - - -class FilterTests(TokenAuthMixin, APITestCase): - url = reverse_lazy("objecttype-list") - - def test_filter_public_data(self): - object_type_1 = ObjectTypeFactory.create( - data_classification=DataClassificationChoices.open - ) - object_type_2 = ObjectTypeFactory.create( - data_classification=DataClassificationChoices.intern - ) - - response = self.client.get( - self.url, {"dataClassification": DataClassificationChoices.open} - ) - - self.assertEqual(response.status_code, status.HTTP_200_OK) - - data = response.json() - - self.assertEqual(len(data), 1) - self.assertEqual( - data[0]["url"], - f"http://testserver{reverse('objecttype-detail', args=[object_type_1.uuid])}", - ) diff --git a/src/objecttypes/tests/v1/test_objecttype_api.py b/src/objecttypes/tests/v1/test_objecttype_api.py deleted file mode 100644 index de47842a..00000000 --- a/src/objecttypes/tests/v1/test_objecttype_api.py +++ /dev/null @@ -1,145 +0,0 @@ -from datetime import date - -from freezegun import freeze_time -from rest_framework import status -from rest_framework.test import APITestCase - -from objecttypes.core.constants import DataClassificationChoices, UpdateFrequencyChoices -from objecttypes.core.models import ObjectType -from objecttypes.core.tests.factories import ObjectTypeFactory, ObjectVersionFactory -from objecttypes.utils.test import TokenAuthMixin - -from .utils import reverse - - -@freeze_time("2020-01-01") -class ObjectTypeAPITests(TokenAuthMixin, APITestCase): - def test_get_objecttypes(self): - object_type = ObjectTypeFactory.create() - object_version = ObjectVersionFactory.create(object_type=object_type) - url = reverse("objecttype-detail", args=[object_type.uuid]) - - response = self.client.get(url) - - self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertEqual( - response.json(), - { - "url": f"http://testserver{url}", - "uuid": str(object_type.uuid), - "name": object_type.name, - "namePlural": object_type.name_plural, - "description": object_type.description, - "dataClassification": object_type.data_classification, - "maintainerOrganization": object_type.maintainer_organization, - "maintainerDepartment": object_type.maintainer_department, - "contactPerson": object_type.contact_person, - "contactEmail": object_type.contact_email, - "source": object_type.source, - "updateFrequency": object_type.update_frequency, - "providerOrganization": object_type.provider_organization, - "documentationUrl": object_type.documentation_url, - "labels": object_type.labels, - "createdAt": "2020-01-01", - "modifiedAt": "2020-01-01", - "allowGeometry": object_type.allow_geometry, - "versions": [ - f"http://testserver{reverse('objectversion-detail', args=[object_type.uuid, object_version.version])}" - ], - }, - ) - - def test_get_objecttypes_with_versions(self): - object_types = ObjectTypeFactory.create_batch(2) - object_versions = [ - ObjectVersionFactory.create(object_type=object_type) - for object_type in object_types - ] - for i, object_type in enumerate(object_types): - with self.subTest(object_type=object_type): - url = reverse("objecttype-detail", args=[object_type.uuid]) - - response = self.client.get(url) - - self.assertEqual(response.status_code, status.HTTP_200_OK) - - data = response.json() - self.assertEqual(len(data["versions"]), 1) - self.assertEqual( - data["versions"], - [ - f"http://testserver{reverse('objectversion-detail', args=[object_type.uuid, object_versions[i].version])}" - ], - ) - - def test_create_objecttype(self): - url = reverse("objecttype-list") - data = { - "name": "boom", - "namePlural": "bomen", - "description": "tree type description", - "dataClassification": DataClassificationChoices.intern, - "maintainerOrganization": "tree municipality", - "maintainerDepartment": "object types department", - "contactPerson": "John Smith", - "contactEmail": "John.Smith@objecttypes.nl", - "source": "tree system", - "updateFrequency": UpdateFrequencyChoices.monthly, - "providerOrganization": "tree provider", - "documentationUrl": "http://example.com/doc/trees", - "labels": {"key1": "value1"}, - "allowGeometry": False, - } - - response = self.client.post(url, data) - - self.assertEqual(response.status_code, status.HTTP_201_CREATED) - self.assertEqual(ObjectType.objects.count(), 1) - - object_type = ObjectType.objects.get() - - self.assertEqual(object_type.name, "boom") - self.assertEqual(object_type.name_plural, "bomen") - self.assertEqual(object_type.description, "tree type description") - self.assertEqual( - object_type.data_classification, DataClassificationChoices.intern - ) - self.assertEqual(object_type.maintainer_organization, "tree municipality") - self.assertEqual(object_type.maintainer_department, "object types department") - self.assertEqual(object_type.contact_person, "John Smith") - self.assertEqual(object_type.contact_email, "John.Smith@objecttypes.nl") - self.assertEqual(object_type.source, "tree system") - self.assertEqual(object_type.update_frequency, UpdateFrequencyChoices.monthly) - self.assertEqual(object_type.provider_organization, "tree provider") - self.assertEqual(object_type.documentation_url, "http://example.com/doc/trees") - self.assertEqual(object_type.labels, {"key1": "value1"}) - self.assertEqual(object_type.created_at, date(2020, 1, 1)) - self.assertEqual(object_type.modified_at, date(2020, 1, 1)) - self.assertEqual(object_type.allow_geometry, False) - - def test_update_objecttype(self): - object_type = ObjectTypeFactory.create( - data_classification=DataClassificationChoices.intern - ) - url = reverse("objecttype-detail", args=[object_type.uuid]) - - response = self.client.patch( - url, {"dataClassification": DataClassificationChoices.open} - ) - - self.assertEqual(response.status_code, status.HTTP_200_OK) - - object_type.refresh_from_db() - - self.assertEqual( - object_type.data_classification, DataClassificationChoices.open - ) - - def test_delete_objecttype(self): - object_type = ObjectTypeFactory.create() - url = reverse("objecttype-detail", args=[object_type.uuid]) - - response = self.client.delete(url) - - self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) - self.assertEqual(ObjectType.objects.count(), 0) diff --git a/src/objecttypes/tests/v1/test_objectversion_api.py b/src/objecttypes/tests/v1/test_objectversion_api.py deleted file mode 100644 index c729d791..00000000 --- a/src/objecttypes/tests/v1/test_objectversion_api.py +++ /dev/null @@ -1,116 +0,0 @@ -from datetime import date - -from freezegun import freeze_time -from rest_framework import status -from rest_framework.test import APITestCase - -from objecttypes.core.constants import ObjectVersionStatus -from objecttypes.core.models import ObjectVersion -from objecttypes.core.tests.factories import ObjectTypeFactory, ObjectVersionFactory -from objecttypes.utils.test import TokenAuthMixin - -from .utils import reverse - -JSON_SCHEMA = { - "type": "object", - "title": "Tree", - "$schema": "http://json-schema.org/draft-07/schema#", - "required": ["diameter"], - "properties": {"diameter": {"type": "integer", "description": "size in cm."}}, -} - - -@freeze_time("2020-01-01") -class ObjectVersionAPITests(TokenAuthMixin, APITestCase): - def test_get_versions(self): - object_type = ObjectTypeFactory.create() - object_version = ObjectVersionFactory.create(object_type=object_type) - url = reverse("objectversion-list", args=[object_type.uuid]) - - response = self.client.get(url) - - self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertEqual( - response.json(), - [ - { - "url": f"http://testserver{reverse('objectversion-detail', args=[object_type.uuid, object_version.version])}", - "version": object_version.version, - "objectType": f"http://testserver{reverse('objecttype-detail', args=[object_version.object_type.uuid])}", - "status": object_version.status, - "createdAt": "2020-01-01", - "modifiedAt": "2020-01-01", - "publishedAt": None, - "jsonSchema": JSON_SCHEMA, - } - ], - ) - - def test_get_versions_incorrect_format_uuid(self): - """ - Regression test for https://github.com/maykinmedia/objects-api/issues/361 - """ - url = reverse("objectversion-list", args=["aaa"]) - - response = self.client.get(url) - - self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) - - def test_create_version(self): - object_type = ObjectTypeFactory.create() - data = {"jsonSchema": JSON_SCHEMA, "status": ObjectVersionStatus.published} - url = reverse("objectversion-list", args=[object_type.uuid]) - - response = self.client.post(url, data) - - self.assertEqual(response.status_code, status.HTTP_201_CREATED) - self.assertEqual(ObjectVersion.objects.count(), 1) - - object_version = ObjectVersion.objects.get() - - self.assertEqual(object_version.object_type, object_type) - self.assertEqual(object_version.json_schema, JSON_SCHEMA) - self.assertEqual(object_version.version, 1) - self.assertEqual(object_version.status, ObjectVersionStatus.published) - self.assertEqual(object_version.created_at, date(2020, 1, 1)) - self.assertEqual(object_version.modified_at, date(2020, 1, 1)) - self.assertEqual(object_version.published_at, date(2020, 1, 1)) - - def test_update_version(self): - object_type = ObjectTypeFactory.create() - object_version = ObjectVersionFactory.create(object_type=object_type) - url = reverse( - "objectversion-detail", args=[object_type.uuid, object_version.version] - ) - new_json_schema = { - "type": "object", - "title": "Tree", - "$schema": "http://json-schema.org/draft-07/schema#", - "required": ["diameter"], - "properties": {"diameter": {"type": "number"}}, - } - - response = self.client.put( - url, - {"jsonSchema": new_json_schema, "status": ObjectVersionStatus.published}, - ) - - self.assertEqual(response.status_code, status.HTTP_200_OK) - - object_version.refresh_from_db() - - self.assertEqual(object_version.json_schema, new_json_schema) - self.assertEqual(object_version.status, ObjectVersionStatus.published) - self.assertEqual(object_version.published_at, date(2020, 1, 1)) - - def test_delete_version(self): - object_type = ObjectTypeFactory.create() - object_version = ObjectVersionFactory.create(object_type=object_type) - url = reverse( - "objectversion-detail", args=[object_type.uuid, object_version.version] - ) - - response = self.client.delete(url) - - self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) - self.assertEqual(ObjectVersion.objects.count(), 0) diff --git a/src/objecttypes/tests/v1/test_schema.py b/src/objecttypes/tests/v1/test_schema.py deleted file mode 100644 index e0b07335..00000000 --- a/src/objecttypes/tests/v1/test_schema.py +++ /dev/null @@ -1,10 +0,0 @@ -from rest_framework import status -from rest_framework.test import APITestCase - -from .utils import reverse - - -class APISchemaTest(APITestCase): - def test_schema_endoint(self): - response = self.client.get(reverse("schema-redoc")) - self.assertEqual(response.status_code, status.HTTP_200_OK) diff --git a/src/objecttypes/tests/v1/test_validation.py b/src/objecttypes/tests/v1/test_validation.py deleted file mode 100644 index 4866cf66..00000000 --- a/src/objecttypes/tests/v1/test_validation.py +++ /dev/null @@ -1,120 +0,0 @@ -import uuid - -from rest_framework import status -from rest_framework.test import APITestCase - -from objecttypes.core.constants import ObjectVersionStatus -from objecttypes.core.tests.factories import ObjectTypeFactory, ObjectVersionFactory -from objecttypes.utils.test import TokenAuthMixin - -from .utils import reverse - - -class ObjectTypeValidationTests(TokenAuthMixin, APITestCase): - def test_patch_objecttype_with_uuid_fail(self): - object_type = ObjectTypeFactory.create() - url = reverse("objecttype-detail", args=[object_type.uuid]) - - response = self.client.patch(url, {"uuid": uuid.uuid4()}) - - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - data = response.json() - self.assertEqual(data["uuid"], ["This field can't be changed"]) - - def test_delete_objecttype_with_versions_fail(self): - object_type = ObjectTypeFactory.create() - ObjectVersionFactory.create(object_type=object_type) - url = reverse("objecttype-detail", args=[object_type.uuid]) - - response = self.client.delete(url) - - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - data = response.json() - self.assertEqual( - data["non_field_errors"], - [ - "All related versions should be destroyed before destroying the objecttype" - ], - ) - - -class ObjectVersionValidationTests(TokenAuthMixin, APITestCase): - def test_create_version_with_incorrect_schema_fail(self): - object_type = ObjectTypeFactory.create() - url = reverse("objectversion-list", args=[object_type.uuid]) - data = { - "jsonSchema": { - "title": "Tree", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "any", - } - } - - response = self.client.post(url, data) - - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - self.assertTrue("jsonSchema" in response.json()) - - def test_create_version_with_incorrect_objecttype_fail(self): - url = reverse("objectversion-list", args=[uuid.uuid4()]) - data = { - "jsonSchema": { - "title": "Tree", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "diameter": {"type": "integer", "description": "size in cm."} - }, - } - } - - response = self.client.post(url, data) - - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - self.assertEqual( - response.json()["non_field_errors"], ["Objecttype url is invalid"] - ) - - def test_update_published_version_fail(self): - object_type = ObjectTypeFactory.create() - object_version = ObjectVersionFactory.create( - object_type=object_type, status=ObjectVersionStatus.published - ) - url = reverse( - "objectversion-detail", args=[object_type.uuid, object_version.version] - ) - new_json_schema = { - "type": "object", - "title": "Tree", - "$schema": "http://json-schema.org/draft-07/schema#", - "required": ["diameter"], - "properties": {"diameter": {"type": "number"}}, - } - - response = self.client.put(url, {"jsonSchema": new_json_schema}) - - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - data = response.json() - self.assertEqual( - data["non_field_errors"], ["Only draft versions can be changed"] - ) - - def test_delete_puclished_version_fail(self): - object_type = ObjectTypeFactory.create() - object_version = ObjectVersionFactory.create( - object_type=object_type, status=ObjectVersionStatus.published - ) - url = reverse( - "objectversion-detail", args=[object_type.uuid, object_version.version] - ) - - response = self.client.delete(url) - - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - - data = response.json() - self.assertEqual( - data["non_field_errors"], ["Only draft versions can be destroyed"] - ) diff --git a/src/objecttypes/tests/v1/utils.py b/src/objecttypes/tests/v1/utils.py deleted file mode 100644 index b78aa92a..00000000 --- a/src/objecttypes/tests/v1/utils.py +++ /dev/null @@ -1,13 +0,0 @@ -from django.urls import reverse as _reverse -from django.utils.functional import lazy - -VERSION = "v1" - - -def reverse(viewname, urlconf=None, args=None, kwargs=None, current_app=None): - """always return api endpoints with predefined version""" - viewname = f"{VERSION}:{viewname}" - return _reverse(viewname, urlconf, args, kwargs, current_app) - - -reverse_lazy = lazy(reverse, str) diff --git a/src/objecttypes/utils/hooks.py b/src/objecttypes/utils/hooks.py deleted file mode 100644 index 07376d66..00000000 --- a/src/objecttypes/utils/hooks.py +++ /dev/null @@ -1,13 +0,0 @@ -from django.conf import settings - - -def postprocess_versions(result, generator, **kwargs): - major_version = result["info"]["version"] - result["info"]["version"] = f"{settings.VERSIONS[major_version]} ({major_version})" - return result - - -def postprocess_servers(result, generator, **kwargs): - major_version = result["info"]["version"] - result["servers"] = settings.OAS_SERVERS[major_version] - return result From 0b55418c2078fb8ae9f0bd9d2840910f4b7015a8 Mon Sep 17 00:00:00 2001 From: Anna Shamray Date: Thu, 26 Sep 2024 15:22:32 +0200 Subject: [PATCH 2/3] :green_heart: [https://github.com/maykinmedia/objects-api/issues/453] black --- src/objecttypes/conf/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objecttypes/conf/api.py b/src/objecttypes/conf/api.py index 7fb4ab63..b60726a3 100644 --- a/src/objecttypes/conf/api.py +++ b/src/objecttypes/conf/api.py @@ -75,5 +75,5 @@ "drf_spectacular.hooks.postprocess_schema_enums", ], "TAGS": [{"name": "Objecttypes"}], - "SERVERS": [{"url": "/api/v2"}] + "SERVERS": [{"url": "/api/v2"}], } From c416aebe22cffab5e269c88acddd35f6fc7cabdc Mon Sep 17 00:00:00 2001 From: Anna Shamray Date: Thu, 3 Oct 2024 15:51:33 +0200 Subject: [PATCH 3/3] :memo: [https://github.com/maykinmedia/objects-api/issues/453] update OAS after rebase --- src/objecttypes/api/v2/openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objecttypes/api/v2/openapi.yaml b/src/objecttypes/api/v2/openapi.yaml index 7f847740..226ac23f 100644 --- a/src/objecttypes/api/v2/openapi.yaml +++ b/src/objecttypes/api/v2/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: Objecttypes API - version: 2.2.2 (v2) + version: 2.2.2 description: |+ An API to manage Object types.