Commit 4c0a0aba authored by Trishna Saeharaseelan's avatar Trishna Saeharaseelan
Browse files

refactor: temp revert to components/schemas

parent bc7486ed
......@@ -8,7 +8,7 @@ __all__ = [
]
abstract_schema = {
"allOf": [{"$ref": "#/definitions/Metadata"}],
"allOf": [{"$ref": "#/components/schemas/Metadata"}],
"type": "object",
"properties": {
"payload": {}
......
......@@ -28,15 +28,15 @@ swagger_config = {
"model_filter": lambda tag: True,
}
],
# "components": {
"definitions": {
"Metadata": message_metadata,
"MissionPlan": full_mission_plan_schema,
"Observation": full_observation_schema,
"PlanningConfiguration": full_planning_configuration_schema,
"PlatformStatus": full_platform_status_message_schema,
"Acknowledgement": full_acknowledgement_schema,
# }
"components": {
"schemas": {
"Metadata": message_metadata,
"MissionPlan": full_mission_plan_schema,
"Observation": full_observation_schema,
"PlanningConfiguration": full_planning_configuration_schema,
"PlatformStatus": full_platform_status_message_schema,
"Acknowledgement": full_acknowledgement_schema,
}
},
"paths": {
"/all_messages": {
......@@ -49,30 +49,26 @@ swagger_config = {
"application/json": {
"schema": {
"oneOf": [
full_mission_plan_schema,
full_planning_configuration_schema,
full_platform_status_message_schema,
full_observation_schema,
# {
# "$ref": "#/definitions/"
# + "Acknowledgement"
# },
# {
# "$ref": "#/definitions/"
# + "MissionPlan"
# },
# {
# "$ref": "#/definitions/"
# + "Observation"
# },
# {
# "$ref": "#/definitions/"
# + "PlanningConfiguration"
# },
# {
# "$ref": "#/definitions/"
# + "PlatformStatus"
# },
{
"$ref": "#/components/schemas/"
+ "Acknowledgement"
},
{
"$ref": "#/components/schemas/"
+ "MissionPlan"
},
{
"$ref": "#/components/schemas/"
+ "Observation"
},
{
"$ref": "#/components/schemas/"
+ "PlanningConfiguration"
},
{
"$ref": "#/components/schemas/"
+ "PlatformStatus"
},
],
"discriminator": {
"propertyName": "message_type",
......@@ -108,7 +104,7 @@ for item in message_types:
"schema": {
"allOf": [
{
"$ref": "#/definitions/" + item,
"$ref": "#/components/schemas/" + item,
},
],
"discriminator": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment