From ca85f5be01c752fdaf40101df092258842c23a1d Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Sun, 24 Jan 2021 00:55:55 +0000 Subject: [PATCH 1/2] [Rust Server] Support Cargo Metadata Configuration --- .../src/main/resources/rust-server/Cargo.mustache | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache index 4c733fbafe4a..a822a9001939 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache @@ -7,6 +7,18 @@ description = "{{{appDescription}}}" {{/appDescription}} license = "Unlicense" edition = "2018" +{{#publishRustRegistry}} +publish = ["{{publishRustRegistry}}"] +{{/publishRustRegistry}} +{{#repositoryUrl}} +repository = "{{repositoryUrl}}" +{{/repositoryUrl}} +{{#documentationUrl}} +documentation = "{{documentationUrl}}" +{{/documentationUrl}} +{{#homePageUrl}} +homepage = "{{homePageUrl}} +{{/homePageUrl}} [features] default = ["client", "server"] From 84aeaf8e72646ca25b4bc8468a4aae98821c28a2 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Sun, 24 Jan 2021 00:56:47 +0000 Subject: [PATCH 2/2] [Rust Server] Test Cargo Metadata configuration --- ...t-server-petstore-with-fake-endpoints-models-for-testing.yaml | 1 + .../petstore-with-fake-endpoints-models-for-testing/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml b/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml index c0f47a60634f..7e009c7d9529 100644 --- a/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml +++ b/bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml @@ -6,3 +6,4 @@ generateAliasAsModel: true additionalProperties: hideGenerationTimestamp: "true" packageName: petstore-with-fake-endpoints-models-for-testing + publishRustRegistry: crates-io diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml index fb3446374456..9c9a34f1aa40 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -5,6 +5,7 @@ authors = [] description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" license = "Unlicense" edition = "2018" +publish = ["crates-io"] [features] default = ["client", "server"]