Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editoast: utoipa for /layers #5809

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 64 additions & 52 deletions editoast/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3383,33 +3383,6 @@ components:
required:
- git_describe
type: object
ViewMetadata:
properties:
attribution:
type: string
maxzoom:
example: 18
type: integer
minzoom:
type: integer
name:
example: track_sections
type: string
promotedId:
example:
track_sections: id
type: object
scheme:
example: xyz
type: string
tiles:
items:
example: http://localhost:7070/tile/track_sections/geo/{z}/{x}/{y}/?infra=1
type: string
type: array
type:
example: vector
type: string
Waypoint:
items:
properties:
Expand Down Expand Up @@ -4399,82 +4372,121 @@ paths:
- infra
/layers/layer/{layer_slug}/mvt/{view_slug}/:
get:
description: Returns layer view metadata to query tiles
parameters:
- in: query
name: infra
required: true
schema:
format: int64
type: integer
- in: path
name: layer_slug
required: true
schema:
title: Layer Slug
type: string
- in: path
name: view_slug
required: true
schema:
title: View Slug
type: string
- in: query
name: infra
required: true
schema:
title: Infra id
type: integer
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ViewMetadata'
properties:
attribution:
type: string
maxzoom:
example: 15
format: int64
minimum: 0
type: integer
minzoom:
format: int64
minimum: 0
type: integer
name:
example: track_sections
type: string
promoteId:
type: object
scheme:
example: xyz
type: string
tiles:
example:
- http://localhost:7070/tile/track_sections/geo/{z}/{x}/{y}/?infra=1
items:
type: string
type: array
type:
type: string
required:
- type
- name
- promoteId
- scheme
- tiles
- attribution
- minzoom
- maxzoom
type: object
description: Successful Response
summary: Mvt View Metadata
summary: Returns layer view metadata to query tiles
tags:
- layers
/layers/tile/{layer_slug}/{view_slug}/{z}/{x}/{y}/:
get:
description: Mvt tile from the cache if possible, otherwise gets data from the database and caches it in redis
parameters:
- in: query
name: infra
required: true
schema:
format: int64
type: integer
- in: path
name: layer_slug
required: true
schema:
title: Layer Slug
type: string
- in: path
name: view_slug
required: true
schema:
title: View Slug
type: string
- in: path
name: z
required: true
schema:
title: Z
type: integer
- in: path
name: x
required: true
schema:
title: X
format: int64
minimum: 0
type: integer
- in: path
name: y
required: true
schema:
title: Y
format: int64
minimum: 0
type: integer
- in: query
name: infra
- in: path
name: z
required: true
schema:
title: Infra
format: int64
minimum: 0
type: integer
responses:
'200':
content:
application/x-octet-stream:
application/octet-stream:
schema:
format: binary
type: string
description: Successful Response
summary: Mvt tile from the cache or the database, cache data in redis if needed
summary: Mvt tile from the cache if possible, otherwise gets data from the database and caches it in redis
tags:
- layers
/light_rolling_stock/:
Expand Down
109 changes: 0 additions & 109 deletions editoast/openapi_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,88 +21,6 @@ tags:
description: Train Schedule

paths:
/layers/layer/{layer_slug}/mvt/{view_slug}/:
get:
tags:
- layers
summary: Mvt View Metadata
parameters:
- required: true
schema:
title: Layer Slug
type: string
name: layer_slug
in: path
- required: true
schema:
title: View Slug
type: string
name: view_slug
in: path
- required: true
schema:
title: Infra id
type: integer
name: infra
in: query
responses:
200:
description: Successful Response
content:
application/json:
schema:
$ref: "#/components/schemas/ViewMetadata"

/layers/tile/{layer_slug}/{view_slug}/{z}/{x}/{y}/:
get:
tags:
- layers
summary: Mvt tile from the cache or the database, cache data in redis if needed
parameters:
- required: true
schema:
title: Layer Slug
type: string
name: layer_slug
in: path
- required: true
schema:
title: View Slug
type: string
name: view_slug
in: path
- required: true
schema:
title: Z
type: integer
name: z
in: path
- required: true
schema:
title: X
type: integer
name: x
in: path
- required: true
schema:
title: Y
type: integer
name: y
in: path
- required: true
schema:
title: Infra
type: integer
name: infra
in: query
responses:
200:
description: Successful Response
content:
application/x-octet-stream:
schema:
type: string

/infra/:
get:
tags:
Expand Down Expand Up @@ -1321,33 +1239,6 @@ components:
navigability: BOTH
track_number: 1

ViewMetadata:
properties:
type:
type: string
example: vector
name:
type: string
example: track_sections
promotedId:
type: object
example: { track_sections: "id" }
scheme:
type: string
example: "xyz"
tiles:
type: array
items:
type: string
example: http://localhost:7070/tile/track_sections/geo/{z}/{x}/{y}/?infra=1
attribution:
type: string
minzoom:
type: integer
maxzoom:
type: integer
example: 18

InfraErrorType:
type: string
description: Type of the infra error
Expand Down
Loading