Skip to content

Commit

Permalink
📝 [maykinmedia/open-api-framework#115] Regenerate schema
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Mar 6, 2025
1 parent d8a8221 commit b7e1eea
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bin/generate_schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export SCHEMA_PATH=src/objects/api/v2/openapi.yaml

OUTPUT_FILE=$1

src/manage.py spectacular --file ${OUTPUT_FILE:-$SCHEMA_PATH} --validate
src/manage.py spectacular --file ${OUTPUT_FILE:-$SCHEMA_PATH} --validate --lang="en"
29 changes: 18 additions & 11 deletions src/objects/api/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,8 @@ paths:
components:
schemas:
GeoJSONGeometry:
title: GeoJSONGeometry
type: object
oneOf:
- $ref: '#/components/schemas/Point'
- $ref: '#/components/schemas/MultiPoint'
Expand All @@ -810,14 +812,6 @@ components:
- $ref: '#/components/schemas/GeometryCollection'
discriminator:
propertyName: type
mapping:
Point: '#/components/schemas/Point'
MultiPoint: '#/components/schemas/MultiPoint'
LineString: '#/components/schemas/LineString'
MultiLineString: '#/components/schemas/MultiLineString'
Polygon: '#/components/schemas/Polygon'
MultiPolygon: '#/components/schemas/MultiPolygon'
GeometryCollection: '#/components/schemas/GeometryCollection'
GeoWithin:
type: object
properties:
Expand All @@ -833,7 +827,8 @@ components:
url: https://tools.ietf.org/html/rfc7946#section-3.1
properties:
type:
type: string
allOf:
- $ref: '#/components/schemas/TypeEnum'
description: The geometry type
GeometryCollection:
type: object
Expand Down Expand Up @@ -986,11 +981,11 @@ components:
url:
type: string
format: uri
readOnly: true
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
Expand Down Expand Up @@ -1143,11 +1138,11 @@ components:
url:
type: string
format: uri
readOnly: true
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
Expand Down Expand Up @@ -1228,6 +1223,18 @@ components:
type: array
items:
$ref: '#/components/schemas/Point2D'
TypeEnum:
type: string
enum:
- Point
- MultiPoint
- LineString
- MultiLineString
- Polygon
- MultiPolygon
- Feature
- FeatureCollection
- GeometryCollection
securitySchemes:
tokenAuth:
type: apiKey
Expand Down
16 changes: 16 additions & 0 deletions src/objects/utils/apps.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
from django.apps import AppConfig

from drf_spectacular.extensions import OpenApiFilterExtension


def unregister_camelize_filter_extension():
"""
CamelizeFilterExtension from vng_api_common is loaded automatically
and cannot be removed using SPECTACULAR_SETTINGS.
"""
OpenApiFilterExtension._registry = [
ext
for ext in OpenApiFilterExtension._registry
if ext.__name__ != "CamelizeFilterExtension"
]


class UtilsConfig(AppConfig):
name = "objects.utils"

def ready(self):
from . import checks # noqa
from . import oas_extensions # noqa

unregister_camelize_filter_extension()

0 comments on commit b7e1eea

Please sign in to comment.