1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-02-23 04:52:28 +00:00

fix panic

This commit is contained in:
Dominic 2019-09-30 18:20:22 +02:00
parent 29af28ad8d
commit 4ceb1ef302
Signed by: msrd0
GPG key ID: DCC8C247452E98F9

View file

@ -156,19 +156,19 @@ macro_rules! implOpenapiRouter {
let path = &self.1;
let mut item = (self.0).1.remove_path(path);
let mut content : IndexMap<String, MediaType> = IndexMap::new();
content[&APPLICATION_JSON.to_string()] = MediaType {
content.insert(APPLICATION_JSON.to_string(), MediaType {
schema: None, // TODO
example: None,
examples: IndexMap::new(),
encoding: IndexMap::new()
};
});
let mut responses : IndexMap<StatusCode, ReferenceOr<Response>> = IndexMap::new();
responses[&StatusCode::Code(200)] = Item(Response {
responses.insert(StatusCode::Code(200), Item(Response {
description: "OK".to_string(),
headers: IndexMap::new(),
content,
links: IndexMap::new()
});
}));
item.get = Some(Operation {
tags: Vec::new(),
summary: None,