forked from loafle/openapi-generator-original
[Rust-Axum] Use x-response-id if specified (#18906)
* [Rust-Axum] Use x-response-id if specified * update samples
This commit is contained in:
parent
8bac93e23b
commit
cc24106832
@ -475,16 +475,18 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
|||||||
original = operation.getResponses().get(rsp.code);
|
original = operation.getResponses().get(rsp.code);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a unique responseID for this response.
|
// Create a unique responseID for this response, if one is not already specified with the "x-response-id" extension
|
||||||
String[] words = rsp.message.split("[^A-Za-z ]");
|
if (!rsp.vendorExtensions.containsKey("x-response-id")) {
|
||||||
|
String[] words = rsp.message.split("[^A-Za-z ]");
|
||||||
|
|
||||||
// build responseId from both status code and description
|
// build responseId from both status code and description
|
||||||
String responseId = "Status" + rsp.code + (
|
String responseId = "Status" + rsp.code + (
|
||||||
((words.length != 0) && (!words[0].trim().isEmpty())) ?
|
((words.length != 0) && (!words[0].trim().isEmpty())) ?
|
||||||
"_" + camelize(words[0].replace(" ", "_")) : ""
|
"_" + camelize(words[0].replace(" ", "_")) : ""
|
||||||
);
|
);
|
||||||
|
rsp.vendorExtensions.put("x-response-id", responseId);
|
||||||
rsp.vendorExtensions.put("x-response-id", responseId);
|
}
|
||||||
|
|
||||||
if (rsp.dataType != null) {
|
if (rsp.dataType != null) {
|
||||||
// Get the mimetype which is produced by this response. Note
|
// Get the mimetype which is produced by this response. Note
|
||||||
// that although in general responses produces a set of
|
// that although in general responses produces a set of
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 1.0.7
|
- API version: 1.0.7
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 1.0.7
|
- API version: 1.0.7
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 0.0.1
|
- API version: 0.0.1
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 1.0
|
- API version: 1.0
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 0.1.9
|
- API version: 0.1.9
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 2.3.4
|
- API version: 2.3.4
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
7.6.0-SNAPSHOT
|
7.7.0-SNAPSHOT
|
||||||
|
@ -12,7 +12,7 @@ server, you can easily generate a server stub.
|
|||||||
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
To see how to make this your own, look here: [README]((https://openapi-generator.tech))
|
||||||
|
|
||||||
- API version: 0.0.1
|
- API version: 0.0.1
|
||||||
- Generator version: 7.6.0-SNAPSHOT
|
- Generator version: 7.7.0-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user