Mercurial > hg > orthanc
comparison OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp @ 4400:029366f95217
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 23 Dec 2020 12:30:56 +0100 |
parents | 80fd140b12ba |
children | 354ea95b294a |
comparison
equal
deleted
inserted
replaced
4399:80fd140b12ba | 4400:029366f95217 |
---|---|
276 Json::Value& schema = target["requestBody"]["content"][EnumerationToString(it->first)]["schema"]; | 276 Json::Value& schema = target["requestBody"]["content"][EnumerationToString(it->first)]["schema"]; |
277 schema["description"] = it->second; | 277 schema["description"] = it->second; |
278 | 278 |
279 if (it->first == MimeType_Json) | 279 if (it->first == MimeType_Json) |
280 { | 280 { |
281 for (Parameters::const_iterator it = requestFields_.begin(); | 281 for (Parameters::const_iterator field = requestFields_.begin(); |
282 it != requestFields_.end(); ++it) | 282 field != requestFields_.end(); ++field) |
283 { | 283 { |
284 Json::Value p = Json::objectValue; | 284 Json::Value p = Json::objectValue; |
285 p["type"] = TypeToString(it->second.type_); | 285 p["type"] = TypeToString(field->second.type_); |
286 p["description"] = it->second.description_; | 286 p["description"] = field->second.description_; |
287 schema["properties"][it->first] = p; | 287 schema["properties"][field->first] = p; |
288 } | 288 } |
289 } | 289 } |
290 } | 290 } |
291 } | 291 } |
292 | 292 |
298 Json::Value& schema = target["responses"]["200"]["content"][EnumerationToString(it->first)]["schema"]; | 298 Json::Value& schema = target["responses"]["200"]["content"][EnumerationToString(it->first)]["schema"]; |
299 schema["description"] = it->second; | 299 schema["description"] = it->second; |
300 | 300 |
301 if (it->first == MimeType_Json) | 301 if (it->first == MimeType_Json) |
302 { | 302 { |
303 for (Parameters::const_iterator it = answerFields_.begin(); | 303 for (Parameters::const_iterator field = answerFields_.begin(); |
304 it != answerFields_.end(); ++it) | 304 field != answerFields_.end(); ++field) |
305 { | 305 { |
306 Json::Value p = Json::objectValue; | 306 Json::Value p = Json::objectValue; |
307 p["type"] = TypeToString(it->second.type_); | 307 p["type"] = TypeToString(field->second.type_); |
308 p["description"] = it->second.description_; | 308 p["description"] = field->second.description_; |
309 schema["properties"][it->first] = p; | 309 schema["properties"][field->first] = p; |
310 } | 310 } |
311 } | 311 } |
312 } | 312 } |
313 | 313 |
314 if (sample_.type() != Json::nullValue) | 314 if (sample_.type() != Json::nullValue) |