Fixes 1367 by preventing pyang discard repeated constituent-base-element-id
[osm/NBI.git] / osm_nbi / nbi.py
index fd2b3e8..ecd6a5a 100644 (file)
@@ -619,7 +619,7 @@ class Server(object):
         if accept:
             if "text/html" in accept:
                 return html.format(data, cherrypy.request, cherrypy.response, token_info)
-            elif "application/yaml" in accept or "*/*" in accept or "text/plain" in accept:
+            elif "application/yaml" in accept or "*/*" in accept:
                 pass
             elif "application/json" in accept or (cherrypy.response.status and cherrypy.response.status >= 300):
                 cherrypy.response.headers["Content-Type"] = 'application/json; charset=utf-8'
@@ -1054,12 +1054,12 @@ class Server(object):
                                                          cherrypy.request.headers.get("Accept"))
                     outdata = file
                 elif not _id:
-                    outdata = self.engine.get_item_list(engine_session, engine_topic, kwargs)
+                    outdata = self.engine.get_item_list(engine_session, engine_topic, kwargs, api_req=True)
                 else:
                     if item == "reports":
                         # TODO check that project_id (_id in this context) has permissions
                         _id = args[0]
-                    outdata = self.engine.get_item(engine_session, engine_topic, _id)
+                    outdata = self.engine.get_item(engine_session, engine_topic, _id, True)
 
             elif method == "POST":
                 cherrypy.response.status = HTTPStatus.CREATED.value