admin管理员组文章数量:1406943
I know is not the intended use of OpenAPI, but I need to hardcode the XML requests to be sent to some endpoints in my OpenAPI specification to workaround some external service for pen-testing that is not working properly with our last specification.
I have such a thing:
{
"openapi" : "3.0.1",
"info" : {
"title" : "OpenAPI definition",
"version" : "v0"
},
"servers" : [
{
"url" : "http://localhost:8083",
"description" : "Server url"
}
],
"paths" : {
"/1/endpoint1" : {
"post" : {
"operationId" : "myOperation-1",
"requestBody" : {
"content" {
"application/xml" : {
"schema" : {
"$ref" : "#/components/schemas/MyOperation1RQ"
}
}
}
}
}
}
}
...
"MyOperation1RQ" : {
"required" : [
"request"
],
"type" : "object",
"properties" : {
"request" : {
"$ref" : "#/components/schemas/MyOperation1RequestRQ"
}
},
"xml" : {
"name" : "My_Operation_1_RQ",
"namespace" : "http://wwwww"
}
}
}
I need to prevent from using the $ref
(or update below in MyOperation1RQ
) so that, instead of the current structure, for MyOperation1RQ
is used a predefined / hardcored request that I have prepared.
<My_Operation_1_RQ namespace=\"http://wwwww\"><Request>...</Request></My_Operation_1_RQ>
I have tried this:
"paths" : {
"/1/endpoint1" : {
"post" : {
"operationId" : "myOperation-1",
"requestBody" : {
"content" {
"application/xml" : {
"schema" : {
"example" : "<My_Operation_1_RQ namespace=\"http://wwwww\"><Request>...</Request></My_Operation_1_RQ>"
}
}
}
}
}
}
}
本文标签: OpenAPI harcoded request for endpointStack Overflow
版权声明:本文标题:OpenAPI harcoded request for endpoint - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745051377a2639675.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论