Skip to content
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 @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
import static org.openapitools.codegen.TestUtils.linearize;

public class RustAxumServerCodegenTest {
@Test
public void testObjectStructFieldIsPublic() throws IOException {
Path target = Files.createTempDirectory("test");
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName("rust-axum")
.setInputSpec("src/test/resources/3_0/petstore.yaml")
.setSkipOverwrite(false)
.setOutputDir(target.toAbsolutePath().toString().replace("\\", "/"));
List<File> files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate();
files.forEach(File::deleteOnExit);
Path typesPath = Path.of(target.toString(), "/src/types.rs");
TestUtils.assertFileExists(typesPath);
TestUtils.assertFileContains(typesPath, "pub struct Object(pub serde_json::Value);");
}

@Test
public void testPreventDuplicateOperationDeclaration() throws IOException {
Path target = Files.createTempDirectory("test");
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.16.0-SNAPSHOT
7.17.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.16.0-SNAPSHOT
- Generator version: 7.17.0-SNAPSHOT



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
#[allow(dead_code)]
pub struct Object(serde_json::Value);
pub struct Object(pub serde_json::Value);

impl validator::Validate for Object {
fn validate(&self) -> Result<(), validator::ValidationErrors> {
Expand Down
Loading