Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rust-Axum] Use x-response-id if specified #18906

Merged
merged 2 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,18 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
original = operation.getResponses().get(rsp.code);
}

// Create a unique responseID for this response.
String[] words = rsp.message.split("[^A-Za-z ]");

// build responseId from both status code and description
String responseId = "Status" + rsp.code + (
((words.length != 0) && (!words[0].trim().isEmpty())) ?
"_" + camelize(words[0].replace(" ", "_")) : ""
);

rsp.vendorExtensions.put("x-response-id", responseId);
// Create a unique responseID for this response, if one is not already specified with the "x-response-id" extension
if (!rsp.vendorExtensions.containsKey("x-response-id")) {
String[] words = rsp.message.split("[^A-Za-z ]");

// build responseId from both status code and description
String responseId = "Status" + rsp.code + (
((words.length != 0) && (!words[0].trim().isEmpty())) ?
"_" + camelize(words[0].replace(" ", "_")) : ""
);
rsp.vendorExtensions.put("x-response-id", responseId);
}

if (rsp.dataType != null) {
// Get the mimetype which is produced by this response. Note
// that although in general responses produces a set of
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 1.0.7
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 1.0.7
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
2 changes: 1 addition & 1 deletion samples/server/petstore/rust-axum/output/ops-v3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 0.0.1
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 1.0.0
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 1.0.0
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 1.0
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 0.1.9
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 2.3.4
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.6.0-SNAPSHOT
7.7.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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))

- API version: 0.0.1
- Generator version: 7.6.0-SNAPSHOT
- Generator version: 7.7.0-SNAPSHOT



Expand Down
Loading