Skip to content

Commit

Permalink
THREESCALE-3927 Converted api to openapi3.0 format and listed on the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhi-soni1104 committed Dec 15, 2022
1 parent 60114c6 commit 1135ede
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 63 deletions.
34 changes: 32 additions & 2 deletions app/views/provider/admin/api_docs/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,42 @@
<p class="InfoBox InfoBox--notice"><%= link_to 'Create an access token', provider_admin_user_access_tokens_path %> to authenticate against the Account Management API, the Analytics API and the Billing API.</p>
<% end %>

<div class='api-docs-wrap' id = "api-docs-wrap"></div>
<div class='api-docs-wrap' id = "analytics-api-docs-wrap"></div>
<div class='api-docs-wrap' id = "billing-api-docs-wrap"></div>
<div class='api-docs-wrap' id = "service-management-api-docs-wrap"></div>
<div class='api-docs-wrap' id = "account-management-api-docs-wrap"></div>
<div class='api-docs-wrap' id = "policy-registry-api-docs-wrap"></div>


<script type="text/javascript">
(function () {
var url = "/api_docs/services/analytics_api.json";
var serviceEndpoint = "<%=j base_url.gsub(%r{/$}, '') %>"
SwaggerUI({ url: url, dom_id: "#api-docs-wrap" }, serviceEndpoint);
SwaggerUI({ url: url, dom_id: "#analytics-api-docs-wrap" }, serviceEndpoint);
}());

(function () {
var url = "/api_docs/services/billing_api.json";
var serviceEndpoint = "<%=j base_url.gsub(%r{/$}, '') %>"
SwaggerUI({ url: url, dom_id: "#billing-api-docs-wrap" }, serviceEndpoint);
}());

(function () {
var url = "/api_docs/services/service_management_api.json";
var serviceEndpoint = "<%=j base_url.gsub(%r{/$}, '') %>"
SwaggerUI({ url: url, dom_id: "#service-management-api-docs-wrap" }, serviceEndpoint);
}());

(function () {
var url = "/api_docs/services/account_management_api.json";
var serviceEndpoint = "<%=j base_url.gsub(%r{/$}, '') %>"
SwaggerUI({ url: url, dom_id: "#account-management-api-docs-wrap" }, serviceEndpoint);
}());


(function () {
var url = "/api_docs/services/policy_registry_api.json";
var serviceEndpoint = "<%=j base_url.gsub(%r{/$}, '') %>"
SwaggerUI({ url: url, dom_id: "#policy-registry-api-docs-wrap" }, serviceEndpoint);
}());
</script>
128 changes: 67 additions & 61 deletions doc/active_docs/Policy Registry API.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"basePath": "",
"apis": [
"openapi": "3.0.1",
"info": {
"version": "1.0"
},
"servers": [
{
"path": "/admin/api/registry/policies.json",
"responseClass": "policy",
"operations": [
{
"httpMethod": "GET",
"summary": "APIcast Policy Registry List",
"description": "List the APIcast Policies",
"group": "apicast_policies",
"parameters": [
"url": "/"
}
],
"paths":{
"/admin/api/registry/policies.json":{
"get":{
"summary": "APIcast Policy Registry List",
"parameters": [
{
"name": "access_token",
"description": "A personal Access Token",
Expand All @@ -19,20 +21,17 @@
"paramType": "query",
"threescale_name": "access_token"
}
]
],
"responses": {
"default": {
"description": "success",
"content": {}
}
}
]
},
{
"path": "/admin/api/registry/policies.json",
"responseClass": "policy",
"operations": [
{
"httpMethod": "POST",
"summary": "APIcast Policy Registry Create",
"description": "Creates an APIcast Policy",
"group": "apicast_policies",
"parameters": [
},
"post":{
"summary": "APIcast Policy Registry Create",
"parameters": [
{
"name": "access_token",
"description": "A personal Access Token",
Expand Down Expand Up @@ -62,20 +61,20 @@
"dataType": "string",
"paramType": "query"
}
]
],
"responses": {
"default": {
"description": "success",
"content": {}
}
}
]
}
},
{
"path": "/admin/api/registry/policies/{id}.json",
"responseClass": "policy",
"operations": [
{
"httpMethod": "GET",
"summary": "APIcast Policy Registry Read",
"description": "Returns the APIcast policy by ID",
"group": "apicast_policies",
"parameters": [
"/admin/api/registry/policies/{id}.json": {
"get" :{
"summary": "APIcast Policy Registry Read",
"description": "Returns the APIcast policy by ID",
"parameters": [
{
"name": "access_token",
"description": "A personal Access Token",
Expand All @@ -91,20 +90,19 @@
"required": true,
"paramType": "path"
}
]
],
"responses": {
"default": {
"description": "success",
"content": {}
}
}
]
},
{
"path": "/admin/api/registry/policies/{id}.json",
"responseClass": "policy",
"operations": [
{
"httpMethod": "PUT",
"summary": "APIcast Policy Registry Update",
"description": "Updates an APIcast Policy",
"group": "apicast_policies",
"parameters": [

},
"put": {
"summary": "APIcast Policy Registry Update",
"description": "Updates an APIcast Policy",
"parameters": [
{
"name": "access_token",
"description": "A personal Access Token",
Expand Down Expand Up @@ -141,14 +139,16 @@
"dataType": "string",
"paramType": "query"
}
]
},
{
"httpMethod": "DELETE",
"summary": "APIcast Policy Registry Delete",
"description": "Deletes an APIcast policy by ID",
"group": "apicast_policies",
"parameters": [
],
"responses": {
"default": {
"description": "success",
"content": {}
}
}
},
"delete": {
"parameters": [
{
"name": "access_token",
"description": "A personal Access Token",
Expand All @@ -164,9 +164,15 @@
"required": true,
"paramType": "path"
}
]
],
"responses": {
"default": {
"description": "success",
"content": {}
}
}
]
}
]

}
}
}
}

0 comments on commit 1135ede

Please sign in to comment.