Skip to content

Commit

Permalink
Use prettier to format JSON output (#213)
Browse files Browse the repository at this point in the history
* Use prettier to format JSON output

* Update transform.js
  • Loading branch information
ralfhandl authored Dec 15, 2022
1 parent efc17bd commit f1fd67c
Show file tree
Hide file tree
Showing 26 changed files with 4,346 additions and 5,876 deletions.
111 changes: 42 additions & 69 deletions examples/Common.Composition-sample.json
Original file line number Diff line number Diff line change
@@ -1,72 +1,45 @@
{
"$Version": "4.0",
"$Reference": {
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [
{
"$Namespace": "com.sap.vocabularies.Common.v1",
"$Alias": "Common"
}
]
}
"$Version": "4.0",
"$Reference": {
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [{ "$Namespace": "com.sap.vocabularies.Common.v1", "$Alias": "Common" }]
}
},
"example.Common.Composition": {
"$Alias": "this",
"container": {
"$Kind": "EntityContainer",
"SalesOrder": {
"$Collection": true,
"$Type": "this.SalesOrder_Type",
"$NavigationPropertyBinding": { "_Item": "SalesOrderItem" }
},
"SalesOrderItem": { "$Collection": true, "$Type": "this.SalesOrderItem_Type" }
},
"example.Common.Composition": {
"$Alias": "this",
"container": {
"$Kind": "EntityContainer",
"SalesOrder": {
"$Collection": true,
"$Type": "this.SalesOrder_Type",
"$NavigationPropertyBinding": {
"_Item": "SalesOrderItem"
}
},
"SalesOrderItem": {
"$Collection": true,
"$Type": "this.SalesOrderItem_Type"
}
},
"SalesOrder_Type": {
"$Kind": "EntityType",
"$Key": [
"SalesOrder"
],
"SalesOrder": {
"$MaxLength": 10
},
"_Item": {
"$Kind": "NavigationProperty",
"$Collection": true,
"$Type": "this.SalesOrderItem_Type",
"$Partner": "_SalesOrder"
}
},
"SalesOrderItem_Type": {
"$Kind": "EntityType",
"$Key": [
"SalesOrder",
"SalesOrderItem"
],
"SalesOrder": {
"$MaxLength": 10
},
"SalesOrderItem": {
"$MaxLength": 6
},
"_SalesOrder": {
"$Kind": "NavigationProperty",
"$Type": "this.SalesOrder_Type",
"$Partner": "_Item",
"$ReferentialConstraint": {
"SalesOrder": "SalesOrder"
}
}
},
"$Annotations": {
"this.SalesOrder_Type/_Item": {
"@Common.Composition": true
}
}
"SalesOrder_Type": {
"$Kind": "EntityType",
"$Key": ["SalesOrder"],
"SalesOrder": { "$MaxLength": 10 },
"_Item": {
"$Kind": "NavigationProperty",
"$Collection": true,
"$Type": "this.SalesOrderItem_Type",
"$Partner": "_SalesOrder"
}
},
"$EntityContainer": "example.Common.Composition.container"
}
"SalesOrderItem_Type": {
"$Kind": "EntityType",
"$Key": ["SalesOrder", "SalesOrderItem"],
"SalesOrder": { "$MaxLength": 10 },
"SalesOrderItem": { "$MaxLength": 6 },
"_SalesOrder": {
"$Kind": "NavigationProperty",
"$Type": "this.SalesOrder_Type",
"$Partner": "_Item",
"$ReferentialConstraint": { "SalesOrder": "SalesOrder" }
}
},
"$Annotations": { "this.SalesOrder_Type/_Item": { "@Common.Composition": true } }
},
"$EntityContainer": "example.Common.Composition.container"
}
120 changes: 37 additions & 83 deletions examples/Common.SAPObjectNodeType-sample.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,40 @@
{
"$Version": "4.0",
"$Reference": {
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [
{
"$Namespace": "com.sap.vocabularies.Common.v1",
"$Alias": "Common"
}
]
}
"$Version": "4.0",
"$Reference": {
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [{ "$Namespace": "com.sap.vocabularies.Common.v1", "$Alias": "Common" }]
}
},
"example.Common.SAPObjectNodeType": {
"$Alias": "this",
"A_Country": {
"$Kind": "EntityType",
"$Key": ["Country"],
"Country": { "$Nullable": true },
"CountryThreeLetterISOCode": { "$Nullable": true, "$MaxLength": 3 }
},
"$Annotations": {
"this.A_Country": { "@Common.SAPObjectNodeType": { "Name": "Country" } },
"this.A_Region": { "@Common.SAPObjectNodeType": { "Name": "Region" } },
"this.A_Region/Country": { "@Common.SAPObjectNodeTypeReference": "Country" },
"this.A_AnyEntity/Country": { "@Common.SAPObjectNodeTypeReference": "Country" },
"this.A_AnyEntity/Region": { "@Common.SAPObjectNodeTypeReference": "Region" },
"this.A_AnyEntity/CountryThreeLetterISOCode": { "@Common.SAPObjectNodeTypeReference": "Country" }
},
"A_Region": {
"$Kind": "EntityType",
"$Key": ["Country", "Region"],
"Country": { "$Nullable": true },
"Region": { "$Nullable": true },
"CountryThreeLetterISOCode": { "$Nullable": true }
},
"example.Common.SAPObjectNodeType": {
"$Alias": "this",
"A_Country": {
"$Kind": "EntityType",
"$Key": [
"Country"
],
"Country": {
"$Nullable": true
},
"CountryThreeLetterISOCode": {
"$Nullable": true,
"$MaxLength": 3
}
},
"$Annotations": {
"this.A_Country": {
"@Common.SAPObjectNodeType": {
"Name": "Country"
}
},
"this.A_Region": {
"@Common.SAPObjectNodeType": {
"Name": "Region"
}
},
"this.A_Region/Country": {
"@Common.SAPObjectNodeTypeReference": "Country"
},
"this.A_AnyEntity/Country": {
"@Common.SAPObjectNodeTypeReference": "Country"
},
"this.A_AnyEntity/Region": {
"@Common.SAPObjectNodeTypeReference": "Region"
},
"this.A_AnyEntity/CountryThreeLetterISOCode": {
"@Common.SAPObjectNodeTypeReference": "Country"
}
},
"A_Region": {
"$Kind": "EntityType",
"$Key": [
"Country",
"Region"
],
"Country": {
"$Nullable": true
},
"Region": {
"$Nullable": true
},
"CountryThreeLetterISOCode": {
"$Nullable": true
}
},
"A_AnyEntity": {
"$Kind": "EntityType",
"$Key": [
"AnyEntity"
],
"AnyEntity": {},
"Country": {
"$Nullable": true
},
"Region": {
"$Nullable": true
},
"CountryThreeLetterISOCode": {
"$Nullable": true,
"$MaxLength": 3
}
}
"A_AnyEntity": {
"$Kind": "EntityType",
"$Key": ["AnyEntity"],
"AnyEntity": {},
"Country": { "$Nullable": true },
"Region": { "$Nullable": true },
"CountryThreeLetterISOCode": { "$Nullable": true, "$MaxLength": 3 }
}
}
}
}
45 changes: 15 additions & 30 deletions examples/Common.Timezone-sample.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
{
"$Version": "4.0",
"$Reference": {
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [
{
"$Namespace": "com.sap.vocabularies.Common.v1",
"$Alias": "Common"
}
]
}
"$Version": "4.0",
"$Reference": {
"https://sap.github.io/odata-vocabularies/vocabularies/Common.json": {
"$Include": [{ "$Namespace": "com.sap.vocabularies.Common.v1", "$Alias": "Common" }]
}
},
"timezone.sample": {
"WorkerTimeSheet": {
"$Kind": "EntityType",
"ClockInDateTime": { "$Type": "Edm.DateTimeOffset", "$Nullable": true, "$Precision": 0 },
"ClockInTimezone": { "$Nullable": true }
},
"timezone.sample": {
"WorkerTimeSheet": {
"$Kind": "EntityType",
"ClockInDateTime": {
"$Type": "Edm.DateTimeOffset",
"$Nullable": true,
"$Precision": 0
},
"ClockInTimezone": {
"$Nullable": true
}
},
"$Annotations": {
"timezone.sample.WorkerTimeSheet/ClockInDateTime": {
"@Common.Timezone": {
"$Path": "ClockInTimezone"
}
}
}
"$Annotations": {
"timezone.sample.WorkerTimeSheet/ClockInDateTime": { "@Common.Timezone": { "$Path": "ClockInTimezone" } }
}
}
}
}
Loading

0 comments on commit f1fd67c

Please sign in to comment.