Skip to content

Commit

Permalink
editoast: remove 'RjsRollingStock' from OpenAPI
Browse files Browse the repository at this point in the history
This type was used but is not anymore. Let's remove the clutter.

Signed-off-by: Jean SIMARD <[email protected]>
  • Loading branch information
woshilapin committed Sep 12, 2024
1 parent f32650f commit 5527122
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 92 deletions.
9 changes: 1 addition & 8 deletions editoast/editoast_schemas/src/rolling_stock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ pub use rolling_stock_livery::RollingStockLiveryMetadata;
use serde::Deserialize;
use serde::Serialize;
use std::collections::HashMap;
use utoipa::ToSchema;

editoast_common::schemas! {
RollingStock,
gamma::schemas(),
effort_curves::schemas(),
energy_source::schemas(),
Expand All @@ -49,12 +47,10 @@ editoast_common::schemas! {

pub const ROLLING_STOCK_RAILJSON_VERSION: &str = "3.2";

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, ToSchema)]
#[schema(as = RjsRollingStock)]
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct RollingStock {
pub name: String,
pub effort_curves: EffortCurves,
#[schema(example = "5", required)]
pub base_power_class: Option<String>,
pub length: f64,
pub max_speed: f64,
Expand All @@ -68,16 +64,13 @@ pub struct RollingStock {
pub loading_gauge: LoadingGaugeType,
/// Mapping of power restriction code to power class
#[serde(default)]
#[schema(required)]
pub power_restrictions: HashMap<String, String>,
#[serde(default)]
pub energy_sources: Vec<EnergySource>,
/// The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric.
#[schema(example = 5.0)]
pub electrical_power_startup_time: Option<f64>,
/// The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric.
#[serde(default)]
#[schema(example = 15.0)]
pub raise_pantograph_time: Option<f64>,
pub supported_signaling_systems: RollingStockSupportedSignalingSystems,
pub railjson_version: String,
Expand Down
84 changes: 0 additions & 84 deletions editoast/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7514,90 +7514,6 @@ components:
begin_position: 0.0
end_position: 1000.0
power_restriction_code: C1US
RjsRollingStock:
type: object
required:
- name
- effort_curves
- base_power_class
- length
- max_speed
- startup_time
- startup_acceleration
- comfort_acceleration
- gamma
- inertia_coefficient
- mass
- rolling_resistance
- loading_gauge
- power_restrictions
- supported_signaling_systems
- railjson_version
properties:
base_power_class:
type: string
example: '5'
nullable: true
comfort_acceleration:
type: number
format: double
effort_curves:
$ref: '#/components/schemas/EffortCurves'
electrical_power_startup_time:
type: number
format: double
description: The time the train takes before actually using electrical power (in seconds). Is null if the train is not electric.
example: 5.0
nullable: true
energy_sources:
type: array
items:
$ref: '#/components/schemas/EnergySource'
gamma:
$ref: '#/components/schemas/Gamma'
inertia_coefficient:
type: number
format: double
length:
type: number
format: double
loading_gauge:
$ref: '#/components/schemas/LoadingGaugeType'
mass:
type: number
format: double
max_speed:
type: number
format: double
metadata:
allOf:
- $ref: '#/components/schemas/RollingStockMetadata'
nullable: true
name:
type: string
power_restrictions:
type: object
description: Mapping of power restriction code to power class
additionalProperties:
type: string
railjson_version:
type: string
raise_pantograph_time:
type: number
format: double
description: The time it takes to raise this train's pantograph in seconds. Is null if the train is not electric.
example: 15.0
nullable: true
rolling_resistance:
$ref: '#/components/schemas/RollingResistance'
startup_acceleration:
type: number
format: double
startup_time:
type: number
format: double
supported_signaling_systems:
$ref: '#/components/schemas/RollingStockSupportedSignalingSystems'
RollingResistance:
type: object
required:
Expand Down

0 comments on commit 5527122

Please sign in to comment.