From 844eb10ddc7675f79df96fdfe7545cea726caf48 Mon Sep 17 00:00:00 2001 From: JohnKeeney Date: Thu, 13 Mar 2025 17:35:59 +0000 Subject: [PATCH] Make OpenAPI files & config schema avaialble in RTD docs Change-Id: I0952c3b2b0060dac4a514276d22c068ec432591d Signed-off-by: JohnKeeney Issue-ID: CCSDK-4073 Signed-off-by: JohnKeeney --- .gitignore | 1 + .readthedocs.yaml | 4 + a1-policy-management/README.md | 2 +- .../application_configuration_schema.json | 91 ++++++++++++++++++++++ a1-policy-management/config/application.yaml | 4 +- a1-policy-management/pom.xml | 6 ++ docs/conf.py | 3 + 7 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 a1-policy-management/api/offeredapis/application_configuration_schema.json diff --git a/.gitignore b/.gitignore index 7ad4a3cb..8a5ff8ea 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ _build/ docs/offeredapis/**/README.md a1-policy-management/api/offeredapis/openapigentool/**/README.md a1-policy-management/api/**/.openapi-generator** +a1-policy-management/custom/ diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 62a44d85..3fb1e2fc 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -31,6 +31,10 @@ build: post_build: - mkdir -p ${READTHEDOCS_OUTPUT}html/openapi - cp -v -r docs/offeredapis/openapitoolgen/offeredapis/pms-api/* ${READTHEDOCS_OUTPUT}html/openapi + - cp -v -r docs/offeredapis/swagger/*.json ${READTHEDOCS_OUTPUT}html/openapi + - cp -v -r docs/offeredapis/swagger/*.yaml ${READTHEDOCS_OUTPUT}html/openapi + - cp -v -r docs/offeredapis/*.json ${READTHEDOCS_OUTPUT}html/openapi + - cp -v -r docs/offeredapis/*.yaml ${READTHEDOCS_OUTPUT}html/openapi python: install: diff --git a/a1-policy-management/README.md b/a1-policy-management/README.md index 746eb650..52505959 100644 --- a/a1-policy-management/README.md +++ b/a1-policy-management/README.md @@ -58,7 +58,7 @@ More information about the ONAP CCSDK A1 Policy Management Service can be found ONAP : ccsdk oran Copyright (C) 2019-2023 Nordix Foundation. All rights reserved. -Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved. +Copyright (C) 2023-2025 OpenInfra Foundation Europe. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/a1-policy-management/api/offeredapis/application_configuration_schema.json b/a1-policy-management/api/offeredapis/application_configuration_schema.json new file mode 100644 index 00000000..3186dae6 --- /dev/null +++ b/a1-policy-management/api/offeredapis/application_configuration_schema.json @@ -0,0 +1,91 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "config": { + "type": "object", + "properties": { + "//description": { + "type": "string" + }, + "description": { + "type": "string" + }, + "controller": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "baseUrl": { + "type": "string" + }, + "userName": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "name", + "baseUrl", + "userName", + "password" + ], + "additionalProperties": false + } + ] + }, + "ric": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "baseUrl": { + "type": "string" + }, + "controller": { + "type": "string" + }, + "customAdapterClass": { + "type": "string" + }, + "managedElementIds": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ] + } + }, + "required": [ + "name", + "baseUrl" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "ric" + ], + "additionalProperties": true + } + }, + "required": [ + "config" + ] +} diff --git a/a1-policy-management/config/application.yaml b/a1-policy-management/config/application.yaml index 47d038ea..95c5f758 100644 --- a/a1-policy-management/config/application.yaml +++ b/a1-policy-management/config/application.yaml @@ -3,7 +3,7 @@ # ONAP : ccsdk oran # ================================================================================ # Copyright (C) 2020-2023 Nordix Foundation. All rights reserved. -# Modifications Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. +# Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ app: # A URL to authorization provider such as OPA. Each time an A1 Policy is accessed, a call to this # authorization provider is done for access control. If this is empty, no fine grained access control is done. authorization-provider: - # the config-file-schema-path referres to a location in the jar file. If this property is empty or missing, + # the config-file-schema-path refers to a location in the jar file. If this property is empty or missing, # no schema validation will be executed. config-file-schema-path: /application_configuration_schema.json # Postgres database usage is enabled using the below parameter. diff --git a/a1-policy-management/pom.xml b/a1-policy-management/pom.xml index 295c6d3e..22142918 100644 --- a/a1-policy-management/pom.xml +++ b/a1-policy-management/pom.xml @@ -635,6 +635,12 @@ openapitoolgen/offeredapis/pms-api/v3/custom/index.html + + ${project.basedir}/src/main/resources/ + + application_configuration_schema.json + + diff --git a/docs/conf.py b/docs/conf.py index 5cd858a3..8696caf7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -84,6 +84,9 @@ spelling_lang = "en_GB" html_extra_path = [ 'offeredapis/openapitoolgen' + # note: + # during the readthedocs build, additional files are copied, e.g. into directory "/openapi" + # See .readthedocs.yaml file ] # -- 2.16.6