Hi,
I am using REST API to dynamically create content. My goal is to:
- Create a page
- Create OPEN Swagger Macro within that page {open-api} JSON {open-api} with JSON content inside it
When posting this via the API, I end up with the following:
{open - api} {
"swagger": "2.0",
"info": {
"version": "v1",
"title": "My API"
},
"paths": {
"/api/Values": {
"get": {
"tags": ["Values"],
"operationId": "Get",
"consumes": [],
"produces": ["text/plain", "application/json", "text/json"],
"parameters": [],
"responses": {
"200": {
"description": "Success",
"schema": {
"uniqueItems": false,
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"post": {
"tags": ["Values"],
"operationId": "Post",
"consumes": ["application/json-patch+json", "application/json", "text/json", "application/*+json"],
"produces": [],
"parameters": [{
"name": "value",
"in": "body",
"required": false,
"schema": {
"type": "string"
}
}],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/api/Values/{id}": {
"get": {
"tags": ["Values"],
"operationId": "Get",
"consumes": [],
"produces": ["text/plain", "application/json", "text/json"],
"parameters": [{
"name": "id",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
}],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "string"
}
}
}
},
"put": {
"tags": ["Values"],
"operationId": "Put",
"consumes": ["application/json-patch+json", "application/json", "text/json", "application/*+json"],
"produces": [],
"parameters": [{
"name": "id",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
}, {
"name": "value",
"in": "body",
"required": false,
"schema": {
"type": "string"
}
}],
"responses": {
"200": {
"description": "Success"
}
}
},
"delete": {
"tags": ["Values"],
"operationId": "Delete",
"consumes": [],
"produces": [],
"parameters": [{
"name": "id",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
}],
"responses": {
"200": {
"description": "Success"
}
}
}
}
},
"definitions": {}
} {open - api}
Whilst JSON is there, the macro is not initialised. My question is how to correctly create and initialise macros via REST API.
The JSON represents a Swagger schema for a dummy API.
Thank you,
Viktor
Hi Viktor
I'm looking to do the same thing with the open-api macro, have you made any progress?
Many thanks,
Linton
Hello Viktor and welcome to the Community!
To understand more of what we’re trying to achieve here, can you please clarify the following?
Are you attempting to create a macro within Confluence OR are you trying to develop a Confluence page with a macro within the content?
I look forward to your response so we can help to get an answer to this.
Regards,
Stephen Sifers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stephan,
I have also facing the same issue.
I wanted to create a confluence page along with the JIRA macro .
Can you please help us on this.
Thanks
Naveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.