[
https://issues.apache.org/jira/browse/NIFI-14144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
endzeit updated NIFI-14144:
---------------------------
Description:
The `swagger.json` / `swagger.yaml` generated during the build process does not
declare the result type for a successful request but the default instead for
some endpoints.
Take the following excerpt:
{code}
"/flowfile-queues/{id}/drop-requests" : {
"post" : {
...
"responses" : {
"202" : {
"description" : "The request has been accepted. A HTTP response
header will contain the URI where the response can be polled."
},
"400" : {
"description" : "NiFi was unable to complete the request because it
was invalid. The request should not be retried without modification."
},
"401" : {
"description" : "Client could not be authenticated."
},
"403" : {
"description" : "Client is not authorized to make this request."
},
"404" : {
"description" : "The specified resource could not be found."
},
"409" : {
"description" : "The request was valid but NiFi was not in the
appropriate state to process it."
},
"default" : {
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/DropRequestEntity"
}
}
}
}
},
...
}
},
{code}
Instead it should be something akin to
{code}
"/flowfile-queues/{id}/drop-requests" : {
"post" : {
...
"responses" : {
"202" : {
"description" : "The request has been accepted. A HTTP response
header will contain the URI where the response can be polled.",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/DropRequestEntity"
}
}
},
"400" : {
"description" : "NiFi was unable to complete the request because it
was invalid. The request should not be retried without modification."
},
"401" : {
"description" : "Client could not be authenticated."
},
"403" : {
"description" : "Client is not authorized to make this request."
},
"404" : {
"description" : "The specified resource could not be found."
},
"409" : {
"description" : "The request was valid but NiFi was not in the
appropriate state to process it."
}
},
...
}
},
{code}
was:xx
> Result types in OpenAPI spec are not declared for success but default instead
> ------------------------------------------------------------------------------
>
> Key: NIFI-14144
> URL: https://issues.apache.org/jira/browse/NIFI-14144
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: endzeit
> Assignee: endzeit
> Priority: Major
>
> The `swagger.json` / `swagger.yaml` generated during the build process does
> not declare the result type for a successful request but the default instead
> for some endpoints.
> Take the following excerpt:
> {code}
> "/flowfile-queues/{id}/drop-requests" : {
> "post" : {
> ...
> "responses" : {
> "202" : {
> "description" : "The request has been accepted. A HTTP response
> header will contain the URI where the response can be polled."
> },
> "400" : {
> "description" : "NiFi was unable to complete the request because
> it was invalid. The request should not be retried without modification."
> },
> "401" : {
> "description" : "Client could not be authenticated."
> },
> "403" : {
> "description" : "Client is not authorized to make this request."
> },
> "404" : {
> "description" : "The specified resource could not be found."
> },
> "409" : {
> "description" : "The request was valid but NiFi was not in the
> appropriate state to process it."
> },
> "default" : {
> "content" : {
> "application/json" : {
> "schema" : {
> "$ref" : "#/components/schemas/DropRequestEntity"
> }
> }
> }
> }
> },
> ...
> }
> },
> {code}
> Instead it should be something akin to
> {code}
> "/flowfile-queues/{id}/drop-requests" : {
> "post" : {
> ...
> "responses" : {
> "202" : {
> "description" : "The request has been accepted. A HTTP response
> header will contain the URI where the response can be polled.",
> "content" : {
> "application/json" : {
> "schema" : {
> "$ref" : "#/components/schemas/DropRequestEntity"
> }
> }
> },
> "400" : {
> "description" : "NiFi was unable to complete the request because
> it was invalid. The request should not be retried without modification."
> },
> "401" : {
> "description" : "Client could not be authenticated."
> },
> "403" : {
> "description" : "Client is not authorized to make this request."
> },
> "404" : {
> "description" : "The specified resource could not be found."
> },
> "409" : {
> "description" : "The request was valid but NiFi was not in the
> appropriate state to process it."
> }
> },
> ...
> }
> },
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)