summaryrefslogtreecommitdiffstats
path: root/cps-rest/docs
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2022-12-13 07:40:19 +0000
committerMichal Jagiello <michal.jagiello@t-mobile.pl>2022-12-22 14:26:34 +0000
commit6ce84d98f68b45f02f16dc99423670f4a53fd946 (patch)
tree76c6e18fac0506acb762ce8078ad7d4605ff6d7d /cps-rest/docs
parentdbf10db6f468075293d61e7bbeb9006fd15cfce6 (diff)
XML content on create anchors node support
Add XML content type support on anchor node creation. Issue-ID: CPS-1257 Change-Id: I7e7a9a1961b6e81de93a4e32e842b47f8a163a09 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Signed-off-by: Lee Anjella Macabuhay <lee.anjella.macabuhay@est.tech>
Diffstat (limited to 'cps-rest/docs')
-rw-r--r--cps-rest/docs/openapi/components.yml20
-rw-r--r--cps-rest/docs/openapi/cpsData.yml13
2 files changed, 32 insertions, 1 deletions
diff --git a/cps-rest/docs/openapi/components.yml b/cps-rest/docs/openapi/components.yml
index 4f138fc898..e700da6ea1 100644
--- a/cps-rest/docs/openapi/components.yml
+++ b/cps-rest/docs/openapi/components.yml
@@ -2,6 +2,7 @@
# Copyright (c) 2021-2022 Bell Canada.
# Modifications Copyright (C) 2021-2022 Nordix Foundation
# Modifications Copyright (C) 2022 TechMahindra Ltd.
+# Modifications Copyright (C) 2022 Deutsche Telekom AG
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -106,6 +107,17 @@ components:
name: SciFi
- code: 02
name: kids
+ dataSampleXml:
+ value:
+ <stores xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <bookstore xmlns="org:onap:ccsdk:sample">
+ <bookstore-name>Chapters</bookstore-name>
+ <categories>
+ <code>1</code>
+ <name>SciFi</name>
+ </categories>
+ </bookstore>
+ </stores>
parameters:
dataspaceNameInQuery:
@@ -220,6 +232,14 @@ components:
type: string
enum: [v1, v2]
default: v2
+ contentTypeHeader:
+ name: Content-Type
+ in: header
+ description: Content type header
+ schema:
+ type: string
+ example: 'application/json'
+ required: true
responses:
NotFound:
diff --git a/cps-rest/docs/openapi/cpsData.yml b/cps-rest/docs/openapi/cpsData.yml
index 9d940c3f83..0dc388706c 100644
--- a/cps-rest/docs/openapi/cpsData.yml
+++ b/cps-rest/docs/openapi/cpsData.yml
@@ -2,6 +2,7 @@
# Copyright (c) 2021-2022 Bell Canada.
# Modifications Copyright (C) 2021-2022 Nordix Foundation
# Modifications Copyright (C) 2022 TechMahindra Ltd.
+# Modifications Copyright (C) 2022 Deutsche Telekom AG
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -130,15 +131,25 @@ nodesByDataspaceAndAnchor:
- $ref: 'components.yml#/components/parameters/anchorNameInPath'
- $ref: 'components.yml#/components/parameters/xpathInQuery'
- $ref: 'components.yml#/components/parameters/observedTimestampInQuery'
+ - $ref: 'components.yml#/components/parameters/contentTypeHeader'
requestBody:
required: true
content:
application/json:
schema:
- type: object
+ type: string
examples:
dataSample:
$ref: 'components.yml#/components/examples/dataSample'
+ application/xml:
+ schema:
+ type: object # Workaround to show example
+ xml:
+ name: stores
+ examples:
+ dataSample:
+ $ref: 'components.yml#/components/examples/dataSampleXml'
+
responses:
'201':
$ref: 'components.yml#/components/responses/Created'