Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Commit dcbe5ca

Browse files
authored
Merge pull request #41 from Virtual-Finland-Development/VFD-310-dataspacen-versiointiin-liittyvat-muutokset
Support for new dataspace versioning uri syntax
2 parents 396b510 + 473e572 commit dcbe5ca

9 files changed

Lines changed: 37 additions & 37 deletions

File tree

src/lib/api_app/src/api/routes/testbed/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use testbed_utils::{access_control_check, service::post_data_product};
2828
})),
2929
responses((status = 200, body = Object, description = "Data product response")),
3030
params(
31-
("data_product" = str, Path, description = "Data product name", example = "draft/Weather/Current/Metric"),
31+
("data_product" = str, Path, description = "Data product name", example = "Weather/Current/Metric"),
3232
("source" = str, Query, description = "Data source name", example = "openweather")
3333
),
3434
)]

src/lib/api_app/src/api/routes/testbed/productizers/nsg/basic_information.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ pub struct NSGAgentBasicInformationRequest {
4545
examples(( "Success" = (
4646
summary = "JSON example",
4747
value = json!("Loading..."),
48-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/BasicInformation.json"
48+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/NSG/Agent/BasicInformation_v1.0.json"
4949
)))
5050
))
5151
)]
5252
pub async fn get_nsg_basic_information(request: ParsedRequest) -> APIResponse {
5353
let request_input: NSGAgentBasicInformationRequest =
5454
serde_json::from_str(request.body.as_str())?;
5555

56-
let data_product = "draft/NSG/Agent/BasicInformation";
56+
let data_product = "NSG/Agent/BasicInformation_v1.0";
5757
let data_source = request.query.first("source").unwrap_or("");
5858

5959
let resolved_data_source = match data_source {
@@ -62,7 +62,7 @@ pub async fn get_nsg_basic_information(request: ParsedRequest) -> APIResponse {
6262
"Missing source parameter".to_string(),
6363
));
6464
}
65-
"virtualfinland" => build_data_product_staged_uri(data_product, data_source),
65+
"accessfinland" => build_data_product_staged_uri(data_product, data_source),
6666
_ => build_data_product_uri(data_product, data_source),
6767
};
6868

src/lib/api_app/src/api/routes/testbed/productizers/nsg/non_listed_company/beneficial_owners/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use app::{responses::APIResponse, router::ParsedRequest};
1010
examples(( "Success" = (
1111
summary = "JSON example",
1212
value = json!("Loading..."),
13-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners.json"
13+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners_v1.0.json"
1414
)))
1515
),
1616
responses((
@@ -20,14 +20,14 @@ use app::{responses::APIResponse, router::ParsedRequest};
2020
examples(( "Success" = (
2121
summary = "JSON example",
2222
value = json!("Loading..."),
23-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners.json"
23+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners_v1.0.json"
2424
)))
2525
)),
2626
security(( "BearerAuth" = [] ))
2727
)]
2828
pub async fn get_beneficial_owners(request: ParsedRequest) -> APIResponse {
29-
let data_product = "draft/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners";
30-
let data_source = "virtualfinland";
29+
let data_product = "NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners_v1.0";
30+
let data_source = "accessfinland";
3131
let result = post_staged_data_product(data_product, data_source, request).await?;
3232
Ok(result)
3333
}

src/lib/api_app/src/api/routes/testbed/productizers/nsg/non_listed_company/establishment/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use app::{responses::APIResponse, router::ParsedRequest};
1010
examples(( "Success" = (
1111
summary = "JSON example",
1212
value = json!("Loading..."),
13-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write.json"
13+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write_v1.0.json"
1414
)))
1515
),
1616
responses((
@@ -20,14 +20,14 @@ use app::{responses::APIResponse, router::ParsedRequest};
2020
examples(( "Success" = (
2121
summary = "JSON example",
2222
value = json!("Loading..."),
23-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write.json"
23+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write_v1.0.json"
2424
)))
2525
)),
2626
security(( "BearerAuth" = [] ))
2727
)]
2828
pub async fn write_establishment(request: ParsedRequest) -> APIResponse {
29-
let data_product = "draft/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write";
30-
let data_source = "virtualfinland";
29+
let data_product = "NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write_v1.0";
30+
let data_source = "accessfinland";
3131
let result = post_staged_data_product(data_product, data_source, request).await?;
3232
Ok(result)
3333
}

src/lib/api_app/src/api/routes/testbed/productizers/nsg/non_listed_company/signatory_rights/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use app::{responses::APIResponse, router::ParsedRequest};
1010
examples(( "Success" = (
1111
summary = "JSON example",
1212
value = json!("Loading..."),
13-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights.json"
13+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights_v1.0.json"
1414
)))
1515
),
1616
responses((
@@ -20,14 +20,14 @@ use app::{responses::APIResponse, router::ParsedRequest};
2020
examples(( "Success" = (
2121
summary = "JSON example",
2222
value = json!("Loading..."),
23-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights.json"
23+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights_v1.0.json"
2424
)))
2525
)),
2626
security(( "BearerAuth" = [] ))
2727
)]
2828
pub async fn get_signatory_rights(request: ParsedRequest) -> APIResponse {
29-
let data_product = "draft/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights";
30-
let data_source = "virtualfinland";
29+
let data_product = "NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights_v1.0";
30+
let data_source = "accessfinland";
3131
let result = post_staged_data_product(data_product, data_source, request).await?;
3232
Ok(result)
3333
}

src/lib/api_app/src/api/routes/testbed/productizers/person/basic_information/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::api::routes::testbed::testbed_utils::get_default_data_product_source;
1111
examples(( "Success" = (
1212
summary = "JSON example",
1313
value = json!("Loading.."),
14-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/Person/BasicInformation.json",
14+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/Person/BasicInformation_v1.0.json",
1515
)))
1616
),
1717
responses((
@@ -21,13 +21,13 @@ use crate::api::routes::testbed::testbed_utils::get_default_data_product_source;
2121
examples(( "Success" = (
2222
summary = "JSON example",
2323
value = json!("Loading.."),
24-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/Person/BasicInformation.json",
24+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/Person/BasicInformation_v1.0.json",
2525
)))
2626
)),
2727
security(( "BearerAuth" = [] ))
2828
)]
2929
pub async fn get_basic_information(request: ParsedRequest) -> APIResponse {
30-
let data_product = "draft/Person/BasicInformation";
30+
let data_product = "Person/BasicInformation_v1.0";
3131
let data_source = &get_default_data_product_source();
3232
let result = super::get_data_product(data_product, data_source, request).await?;
3333
Ok(result)
@@ -42,7 +42,7 @@ pub async fn get_basic_information(request: ParsedRequest) -> APIResponse {
4242
examples(( "Success" = (
4343
summary = "JSON example",
4444
value = json!("Loading.."),
45-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/Person/BasicInformation/Write.json",
45+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/Person/BasicInformation/Write_v1.0.json",
4646
)))
4747
),
4848
responses((
@@ -52,13 +52,13 @@ pub async fn get_basic_information(request: ParsedRequest) -> APIResponse {
5252
examples(( "Success" = (
5353
summary = "JSON example",
5454
value = json!("Loading.."),
55-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/Person/BasicInformation/Write.json",
55+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/Person/BasicInformation/Write_v1.0.json",
5656
))
5757
))),
5858
security(( "BearerAuth" = [] ))
5959
)]
6060
pub async fn write_basic_information(request: ParsedRequest) -> APIResponse {
61-
let data_product = "draft/Person/BasicInformation/Write";
61+
let data_product = "Person/BasicInformation/Write_v1.0";
6262
let data_source = &get_default_data_product_source();
6363
let result = super::write_data_product(data_product, data_source, request).await?;
6464
Ok(result)

src/lib/api_app/src/api/routes/testbed/productizers/person/job_applicant_profile/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::api::routes::testbed::testbed_utils::get_default_data_product_source;
1111
examples(( "Success" = (
1212
summary = "JSON example",
1313
value = json!("Loading.."),
14-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/Person/JobApplicantProfile.json",
14+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/Person/JobApplicantProfile_v1.0.json",
1515
)))
1616
),
1717
responses((
@@ -21,13 +21,13 @@ use crate::api::routes::testbed::testbed_utils::get_default_data_product_source;
2121
examples(( "Success" = (
2222
summary = "JSON example",
2323
value = json!("Loading.."),
24-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/Person/JobApplicantProfile.json",
24+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/Person/JobApplicantProfile_v1.0.json",
2525
)))
2626
)),
2727
security(( "BearerAuth" = [] ))
2828
)]
2929
pub async fn get_job_applicant_profile(request: ParsedRequest) -> APIResponse {
30-
let data_product = "draft/Person/JobApplicantProfile";
30+
let data_product = "Person/JobApplicantProfile_v1.0";
3131
let data_source = &get_default_data_product_source();
3232
let result = super::get_data_product(data_product, data_source, request).await?;
3333
Ok(result)
@@ -42,7 +42,7 @@ pub async fn get_job_applicant_profile(request: ParsedRequest) -> APIResponse {
4242
examples(( "Success" = (
4343
summary = "JSON example",
4444
value = json!("Loading.."),
45-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/Person/JobApplicantProfile/Write.json",
45+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/Person/JobApplicantProfile/Write_v1.0.json",
4646
)))
4747
),
4848
responses((
@@ -52,13 +52,13 @@ pub async fn get_job_applicant_profile(request: ParsedRequest) -> APIResponse {
5252
examples(( "Success" = (
5353
summary = "JSON example",
5454
value = json!("Loading.."),
55-
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/draft/Person/JobApplicantProfile/Write.json",
55+
external_value = "https://raw.githubusercontent.com/Virtual-Finland/definitions/main/DataProducts/Person/JobApplicantProfile/Write_v1.0.json",
5656
)))
5757
)),
5858
security(( "BearerAuth" = [] ))
5959
)]
6060
pub async fn write_job_applicant_profile(request: ParsedRequest) -> APIResponse {
61-
let data_product = "draft/Person/JobApplicantProfile/Write";
61+
let data_product = "Person/JobApplicantProfile/Write_v1.0";
6262
let data_source = &get_default_data_product_source();
6363
let result = super::write_data_product(data_product, data_source, request).await?;
6464
Ok(result)

src/lib/api_app/src/api/routes/testbed/testbed_utils.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,35 +83,35 @@ pub fn build_data_product_uri(data_product: &str, data_source: &str) -> String {
8383
testbed_base_url = env::var("USER_STATUS_INFO_PRODUCTIZER_ENDPOINT")
8484
.expect("USER_STATUS_INFO_PRODUCTIZER_ENDPOINT must be set");
8585
}
86-
"draft/NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write" => {
86+
"NSG/Agent/LegalEntity/NonListedCompany/Establishment/Write_v1.0" => {
8787
testbed_base_url = env::var("PRH_MOCK_PRODUCTIZER_ENDPOINT")
8888
.expect("PRH_MOCK_PRODUCTIZER_ENDPOINT must be set");
8989
}
90-
"draft/NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners" => {
90+
"NSG/Agent/LegalEntity/NonListedCompany/BeneficialOwners_v1.0" => {
9191
testbed_base_url = env::var("PRH_MOCK_PRODUCTIZER_ENDPOINT")
9292
.expect("PRH_MOCK_PRODUCTIZER_ENDPOINT must be set");
9393
}
94-
"draft/NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights" => {
94+
"NSG/Agent/LegalEntity/NonListedCompany/SignatoryRights_v1.0" => {
9595
testbed_base_url = env::var("PRH_MOCK_PRODUCTIZER_ENDPOINT")
9696
.expect("PRH_MOCK_PRODUCTIZER_ENDPOINT must be set");
9797
}
98-
"draft/Person/BasicInformation" => {
98+
"Person/BasicInformation_v1.0" => {
9999
testbed_base_url = env::var("USER_PROFILE_PRODUCTIZER_ENDPOINT")
100100
.expect("USER_PROFILE_PRODUCTIZER_ENDPOINT must be set");
101101
}
102-
"draft/Person/BasicInformation/Write" => {
102+
"Person/BasicInformation/Write_v1.0" => {
103103
testbed_base_url = env::var("USER_PROFILE_PRODUCTIZER_ENDPOINT")
104104
.expect("USER_PROFILE_PRODUCTIZER_ENDPOINT must be set");
105105
}
106-
"draft/Person/JobApplicantProfile" => {
106+
"Person/JobApplicantProfile_v1.0" => {
107107
testbed_base_url = env::var("USER_PROFILE_PRODUCTIZER_ENDPOINT")
108108
.expect("USER_PROFILE_PRODUCTIZER_ENDPOINT must be set");
109109
}
110-
"draft/Person/JobApplicantProfile/Write" => {
110+
"Person/JobApplicantProfile/Write_v1.0" => {
111111
testbed_base_url = env::var("USER_PROFILE_PRODUCTIZER_ENDPOINT")
112112
.expect("USER_PROFILE_PRODUCTIZER_ENDPOINT must be set");
113113
}
114-
"draft/NSG/Agent/BasicInformation" => {
114+
"NSG/Agent/BasicInformation_v1.0" => {
115115
if data_source.starts_with("virtualfinland") {
116116
testbed_base_url = env::var("PRH_MOCK_PRODUCTIZER_ENDPOINT")
117117
.expect("PRH_MOCK_PRODUCTIZER_ENDPOINT must be set");

src/lib/api_app/src/tests/api_router_test/mocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use utoipa::OpenApi;
1515
get,
1616
path = "/test/{data_product}",
1717
params(
18-
("data_product" = str, Path, description = "Data product name", example = "draft/Weather/Current/Metric"),
18+
("data_product" = str, Path, description = "Data product name", example = "Weather/Current/Metric"),
1919
("source" = str, Query, description = "Data source name", example = "openweather")
2020
),
2121
)]

0 commit comments

Comments
 (0)