@@ -26,9 +26,9 @@ use crate::v2::{
2626 stats:: Stats ,
2727} ;
2828
29- /// Returns the default file format version for v2 schemas .
30- fn default_file_format ( ) -> String {
31- "2.0.0 " . to_owned ( )
29+ /// Returns the file format version for v2 resolved schema .
30+ fn resolved_file_format ( ) -> String {
31+ "2/resolved " . to_owned ( )
3232}
3333
3434pub mod attribute;
@@ -49,13 +49,11 @@ pub mod stats;
4949#[ serde( deny_unknown_fields) ]
5050pub struct ResolvedTelemetrySchema {
5151 /// Version of the file structure.
52- #[ serde( default = "default_file_format " ) ]
52+ #[ serde( default = "resolved_file_format " ) ]
5353 pub file_format : String ,
54- /// Schema URL that this file is published at.
55- pub schema_url : String ,
5654 /// The URL of the registry that this schema belongs to.
5755 #[ serde( skip_serializing_if = "String::is_empty" ) ]
58- pub registry_url : String ,
56+ pub schema_url : String ,
5957 /// Catalog of attributes. Note: this will include duplicates for the same key.
6058 pub attribute_catalog : Vec < Attribute > ,
6159 /// The registry that this schema belongs to.
@@ -130,9 +128,8 @@ impl TryFrom<crate::ResolvedTelemetrySchema> for ResolvedTelemetrySchema {
130128 let ( attribute_catalog, registry, refinements) =
131129 convert_v1_to_v2 ( value. catalog , value. registry ) ?;
132130 Ok ( ResolvedTelemetrySchema {
133- file_format : default_file_format ( ) ,
131+ file_format : resolved_file_format ( ) ,
134132 schema_url : value. schema_url ,
135- registry_url : value. registry_id ,
136133 attribute_catalog,
137134 registry,
138135 refinements,
@@ -505,7 +502,6 @@ pub fn convert_v1_to_v2(
505502 }
506503
507504 let v2_registry = Registry {
508- registry_url : r. registry_url ,
509505 attributes,
510506 spans,
511507 metrics,
@@ -1005,9 +1001,8 @@ mod tests {
10051001 let v2_schema: Result < ResolvedTelemetrySchema , _ > = v1_schema. try_into ( ) ;
10061002 assert ! ( v2_schema. is_ok( ) ) ;
10071003 let v2_schema = v2_schema. unwrap ( ) ;
1008- assert_eq ! ( v2_schema. file_format, default_file_format ( ) ) ;
1004+ assert_eq ! ( v2_schema. file_format, resolved_file_format ( ) ) ;
10091005 assert_eq ! ( v2_schema. schema_url, "my.schema.url" ) ;
1010- assert_eq ! ( v2_schema. registry_url, "my-registry" ) ;
10111006 }
10121007
10131008 #[ test]
@@ -1214,14 +1209,12 @@ mod tests {
12141209 // create an empty schema for testing.
12151210 fn empty_v2_schema ( ) -> ResolvedTelemetrySchema {
12161211 ResolvedTelemetrySchema {
1217- file_format : default_file_format ( ) ,
1212+ file_format : resolved_file_format ( ) ,
12181213 schema_url : "my.schema.url" . to_owned ( ) ,
1219- registry_url : "main" . to_owned ( ) ,
12201214 attribute_catalog : vec ! [ ] ,
12211215 registry : Registry {
12221216 attributes : vec ! [ ] ,
12231217 attribute_groups : vec ! [ ] ,
1224- registry_url : "todo" . to_owned ( ) ,
12251218 spans : vec ! [ ] ,
12261219 metrics : vec ! [ ] ,
12271220 events : vec ! [ ] ,
0 commit comments