From 7e335d504f2a98f828542979c1189dd680231af8 Mon Sep 17 00:00:00 2001 From: neodarz Date: Wed, 11 Sep 2019 16:46:48 +0200 Subject: Add ability to have an mongoid object in def --- api/umosapi.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/umosapi.cpp b/api/umosapi.cpp index 989dbe2..5c8717a 100644 --- a/api/umosapi.cpp +++ b/api/umosapi.cpp @@ -179,6 +179,9 @@ void UmosapiService::Api::propertie(std::string name, std::string format, std::s UmosapiService::Api::_swagger["definitions"][UmosapiService::Api::_definition.name]["type"] = "array"; std::string schema_path = "#/definitions/"; UmosapiService::Api::_swagger["definitions"][UmosapiService::Api::_definition.name]["items"]["$ref"] = schema_path.append(name); + } else if (format == "mongoid") { + UmosapiService::Api::_swagger["definitions"][UmosapiService::Api::_definition.name]["properties"][name]["type"] = "object"; + UmosapiService::Api::_swagger["definitions"][UmosapiService::Api::_definition.name]["properties"][name]["properties"]["$oid"][type] = "string"; } else { UmosapiService::Api::_swagger["definitions"][UmosapiService::Api::_definition.name]["properties"][name]["format"] = format; UmosapiService::Api::_swagger["definitions"][UmosapiService::Api::_definition.name]["properties"][name]["type"] = type; -- cgit v1.2.1