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__ = [ ...@@ -8,7 +8,7 @@ __all__ = [
] ]
abstract_schema = { abstract_schema = {
"allOf": [{"$ref": "#/definitions/Metadata"}], "allOf": [{"$ref": "#/components/schemas/Metadata"}],
"type": "object", "type": "object",
"properties": { "properties": {
"payload": {} "payload": {}
......
...@@ -28,15 +28,15 @@ swagger_config = { ...@@ -28,15 +28,15 @@ swagger_config = {
"model_filter": lambda tag: True, "model_filter": lambda tag: True,
} }
], ],
# "components": { "components": {
"definitions": { "schemas": {
"Metadata": message_metadata, "Metadata": message_metadata,
"MissionPlan": full_mission_plan_schema, "MissionPlan": full_mission_plan_schema,
"Observation": full_observation_schema, "Observation": full_observation_schema,
"PlanningConfiguration": full_planning_configuration_schema, "PlanningConfiguration": full_planning_configuration_schema,
"PlatformStatus": full_platform_status_message_schema, "PlatformStatus": full_platform_status_message_schema,
"Acknowledgement": full_acknowledgement_schema, "Acknowledgement": full_acknowledgement_schema,
# } }
}, },
"paths": { "paths": {
"/all_messages": { "/all_messages": {
...@@ -49,30 +49,26 @@ swagger_config = { ...@@ -49,30 +49,26 @@ swagger_config = {
"application/json": { "application/json": {
"schema": { "schema": {
"oneOf": [ "oneOf": [
full_mission_plan_schema, {
full_planning_configuration_schema, "$ref": "#/components/schemas/"
full_platform_status_message_schema, + "Acknowledgement"
full_observation_schema, },
# { {
# "$ref": "#/definitions/" "$ref": "#/components/schemas/"
# + "Acknowledgement" + "MissionPlan"
# }, },
# { {
# "$ref": "#/definitions/" "$ref": "#/components/schemas/"
# + "MissionPlan" + "Observation"
# }, },
# { {
# "$ref": "#/definitions/" "$ref": "#/components/schemas/"
# + "Observation" + "PlanningConfiguration"
# }, },
# { {
# "$ref": "#/definitions/" "$ref": "#/components/schemas/"
# + "PlanningConfiguration" + "PlatformStatus"
# }, },
# {
# "$ref": "#/definitions/"
# + "PlatformStatus"
# },
], ],
"discriminator": { "discriminator": {
"propertyName": "message_type", "propertyName": "message_type",
...@@ -108,7 +104,7 @@ for item in message_types: ...@@ -108,7 +104,7 @@ for item in message_types:
"schema": { "schema": {
"allOf": [ "allOf": [
{ {
"$ref": "#/definitions/" + item, "$ref": "#/components/schemas/" + item,
}, },
], ],
"discriminator": { "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