diff options
author | neodarz <neodarz@neodarz.net> | 2019-09-11 16:46:48 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-09-11 16:46:48 +0200 |
commit | 7e335d504f2a98f828542979c1189dd680231af8 (patch) | |
tree | 1e2776c3eece0885715d73659047d0447a898bb9 | |
parent | 4a1a02b55e6d1b55e44560c728a47875411da333 (diff) | |
download | umosapicpp-7e335d504f2a98f828542979c1189dd680231af8.tar.xz umosapicpp-7e335d504f2a98f828542979c1189dd680231af8.zip |
Add ability to have an mongoid object in def
Diffstat (limited to '')
-rw-r--r-- | api/umosapi.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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; |