Skip to content

Commit

Permalink
fix: add missing tos (#522)
Browse files Browse the repository at this point in the history
Adds missing tos from openapi info.

Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro authored Jun 27, 2024
1 parent 7a31e10 commit c7e9575
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/src/v2/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ pub struct Info {
pub title: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "termsOfService", skip_serializing_if = "Option::is_none")]
pub terms_of_service: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub contact: Option<Contact>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
2 changes: 1 addition & 1 deletion core/src/v3/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ impl From<v2::Info> for openapiv3::Info {
openapiv3::Info {
title: v2.title,
description: v2.description,
terms_of_service: None,
terms_of_service: v2.terms_of_service,
contact: v2.contact.map(|c| c.into()),
license: v2.license.map(From::from),
version: v2.version,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2389,6 +2389,7 @@ fn test_tags() {
spec.info = Info {
version: "0.1".into(),
title: "Image server".into(),
terms_of_service: Some("http://test.io/terms/".into()),
extensions,
..Default::default()
};
Expand Down Expand Up @@ -2439,6 +2440,7 @@ fn test_tags() {
"info":{
"title":"Image server",
"version":"0.1",
"termsOfService":"http://test.io/terms/",
"x-my-attr":true
},
"x-root-level-extension": false,
Expand Down

0 comments on commit c7e9575

Please sign in to comment.