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: provide details when pathfinding failed #9162

Merged
merged 3 commits into from
Oct 23, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ val polymorphicPathfindingResponseAdapter: PolymorphicJsonAdapterFactory<Pathfin
.withSubtype(NotFoundInTracks::class.java, "not_found_in_tracks")
.withSubtype(IncompatibleConstraintsPathResponse::class.java, "incompatible_constraints")
.withSubtype(NotEnoughPathItems::class.java, "not_enough_path_items")
.withSubtype(PathfindingFailed::class.java, "pathfinding_failed")
.withSubtype(PathfindingFailed::class.java, "internal_error")

val pathfindingResponseAdapter: JsonAdapter<PathfindingBlockResponse> =
Moshi.Builder()
Expand Down
290 changes: 163 additions & 127 deletions editoast/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7391,6 +7391,39 @@ components:
items:
$ref: '#/components/schemas/TrackRange'
description: List of track sections
PathfindingFailure:
oneOf:
- allOf:
- $ref: '#/components/schemas/PathfindingInputError'
- type: object
required:
- failed_status
properties:
failed_status:
type: string
enum:
- pathfinding_input_error
- allOf:
- $ref: '#/components/schemas/PathfindingNotFound'
- type: object
required:
- failed_status
properties:
failed_status:
type: string
enum:
- pathfinding_not_found
- type: object
required:
- core_error
- failed_status
properties:
core_error:
$ref: '#/components/schemas/InternalError'
failed_status:
type: string
enum:
- internal_error
PathfindingInput:
type: object
description: |-
Expand Down Expand Up @@ -7435,6 +7468,49 @@ components:
items:
type: string
description: List of supported signaling systems
PathfindingInputError:
oneOf:
- type: object
required:
- items
- error_type
properties:
error_type:
type: string
enum:
- invalid_path_items
items:
type: array
items:
type: object
required:
- index
- path_item
properties:
index:
type: integer
minimum: 0
path_item:
$ref: '#/components/schemas/PathItemLocation'
- type: object
required:
- error_type
properties:
error_type:
type: string
enum:
- not_enough_path_items
- type: object
required:
- rolling_stock_name
- error_type
properties:
error_type:
type: string
enum:
- rolling_stock_not_found
rolling_stock_name:
type: string
PathfindingItem:
type: object
required:
Expand All @@ -7452,55 +7528,22 @@ components:
allOf:
- $ref: '#/components/schemas/StepTimingData'
nullable: true
PathfindingOutput:
type: object
required:
- track_ranges
- detectors
- switches_directions
properties:
detectors:
type: array
items:
type: string
maxLength: 255
minLength: 1
switches_directions:
type: object
additionalProperties:
type: string
maxLength: 255
minLength: 1
track_ranges:
type: array
items:
$ref: '#/components/schemas/DirectionalTrackRange'
PathfindingResult:
PathfindingNotFound:
oneOf:
- allOf:
- $ref: '#/components/schemas/PathfindingResultSuccess'
- type: object
required:
- status
properties:
status:
type: string
enum:
- success
- type: object
required:
- track_section_ranges
- length
- status
- error_type
properties:
error_type:
type: string
enum:
- not_found_in_blocks
length:
type: integer
format: int64
minimum: 0
status:
type: string
enum:
- not_found_in_blocks
track_section_ranges:
type: array
items:
Expand All @@ -7509,94 +7552,87 @@ components:
required:
- track_section_ranges
- length
- status
- error_type
properties:
error_type:
type: string
enum:
- not_found_in_routes
length:
type: integer
format: int64
minimum: 0
status:
type: string
enum:
- not_found_in_routes
track_section_ranges:
type: array
items:
$ref: '#/components/schemas/TrackRange'
- type: object
required:
- status
- error_type
properties:
status:
error_type:
type: string
enum:
- not_found_in_tracks
- type: object
required:
- relaxed_constraints_path
- incompatible_constraints
- status
- error_type
properties:
error_type:
type: string
enum:
- incompatible_constraints
incompatible_constraints:
$ref: '#/components/schemas/IncompatibleConstraints'
relaxed_constraints_path:
$ref: '#/components/schemas/PathfindingResultSuccess'
status:
type: string
enum:
- incompatible_constraints
- type: object
required:
- items
- status
properties:
PathfindingOutput:
type: object
required:
- track_ranges
- detectors
- switches_directions
properties:
detectors:
type: array
items:
type: array
items:
type: object
required:
- index
- path_item
properties:
index:
type: integer
minimum: 0
path_item:
$ref: '#/components/schemas/PathItemLocation'
status:
type: string
enum:
- invalid_path_items
- type: object
required:
- status
properties:
status:
type: string
enum:
- not_enough_path_items
- type: object
required:
- rolling_stock_name
- status
properties:
rolling_stock_name:
type: string
status:
type: string
enum:
- rolling_stock_not_found
- type: object
required:
- core_error
- status
properties:
core_error:
$ref: '#/components/schemas/InternalError'
status:
maxLength: 255
minLength: 1
switches_directions:
type: object
additionalProperties:
type: string
enum:
- pathfinding_failed
maxLength: 255
minLength: 1
track_ranges:
type: array
items:
$ref: '#/components/schemas/DirectionalTrackRange'
PathfindingResult:
oneOf:
- allOf:
- $ref: '#/components/schemas/PathfindingResultSuccess'
- type: object
required:
- status
properties:
status:
type: string
enum:
- success
- allOf:
- $ref: '#/components/schemas/PathfindingFailure'
- type: object
required:
- status
properties:
status:
type: string
enum:
- failure
PathfindingResultSuccess:
type: object
description: A successful pathfinding result. This is also used for STDCM response.
Expand Down Expand Up @@ -9558,11 +9594,11 @@ components:
- success
- type: object
required:
- pathfinding_result
- pathfinding_failed
- status
properties:
pathfinding_result:
$ref: '#/components/schemas/PathfindingResult'
pathfinding_failed:
$ref: '#/components/schemas/PathfindingFailure'
status:
type: string
enum:
Expand Down Expand Up @@ -9636,26 +9672,28 @@ components:
format: int64
description: Travel time in ms
minimum: 0
- type: object
required:
- status
properties:
status:
type: string
enum:
- pathfinding_not_found
- allOf:
- $ref: '#/components/schemas/PathfindingNotFound'
- type: object
required:
- status
properties:
status:
type: string
enum:
- pathfinding_not_found
- type: object
description: An error has occured during pathfinding
required:
- error_type
- core_error
- status
properties:
error_type:
type: string
core_error:
$ref: '#/components/schemas/InternalError'
status:
type: string
enum:
- pathfinding_failed
- pathfinding_failure
- type: object
description: An error has occured during computing
required:
Expand All @@ -9668,18 +9706,16 @@ components:
type: string
enum:
- simulation_failed
- type: object
description: Rolling stock not found
required:
- rolling_stock_name
- status
properties:
rolling_stock_name:
type: string
status:
type: string
enum:
- rolling_stock_not_found
- allOf:
- $ref: '#/components/schemas/PathfindingInputError'
- type: object
required:
- status
properties:
status:
type: string
enum:
- pathfinding_input_error
Slope:
type: object
required:
Expand Down
Loading
Loading