From d680090cb993137eb3adb37d5b3ec898d66db531 Mon Sep 17 00:00:00 2001 From: Mahmoud Alkhraishi Date: Fri, 21 Jun 2024 12:05:55 -0400 Subject: [PATCH 1/2] updates open-api generation script, and open-api version to 3.1.0, which fixes all validationissues. --- .../environmentalImpactCredential.yml | 2 +- docs/openapi/openapi.yml | 273 +++++++++++++++++- .../scripts/schemas-to-openapi.js | 3 +- 3 files changed, 275 insertions(+), 3 deletions(-) diff --git a/docs/openapi/components/schemas/credentials/environmentalImpactCredential.yml b/docs/openapi/components/schemas/credentials/environmentalImpactCredential.yml index 0bc97fc4f..584550897 100644 --- a/docs/openapi/components/schemas/credentials/environmentalImpactCredential.yml +++ b/docs/openapi/components/schemas/credentials/environmentalImpactCredential.yml @@ -142,4 +142,4 @@ example: |- }, "CO2e": "1190" } - } + } \ No newline at end of file diff --git a/docs/openapi/openapi.yml b/docs/openapi/openapi.yml index 5096b8fba..027d721ba 100644 --- a/docs/openapi/openapi.yml +++ b/docs/openapi/openapi.yml @@ -1,5 +1,5 @@ -openapi: 3.0.0 +openapi: 3.1.0 info: title: Traceability Schemas version: 1.0.0 @@ -14,6 +14,7 @@ paths: - common responses: '200': + description: 'successfully issued AgricultureActivity schema.' content: application/yml: schema: @@ -26,6 +27,7 @@ paths: - common responses: '200': + description: 'successfully issued AgricultureInspectionCommonInfo schema.' content: application/yml: schema: @@ -38,6 +40,7 @@ paths: - common responses: '200': + description: 'successfully issued AgricultureInspectionGeneric schema.' content: application/yml: schema: @@ -50,6 +53,7 @@ paths: - common responses: '200': + description: 'successfully issued AgriculturePackage schema.' content: application/yml: schema: @@ -62,6 +66,7 @@ paths: - common responses: '200': + description: 'successfully issued AgricultureParcelDelivery schema.' content: application/yml: schema: @@ -74,6 +79,7 @@ paths: - common responses: '200': + description: 'successfully issued AgricultureProduct schema.' content: application/yml: schema: @@ -86,6 +92,7 @@ paths: - common responses: '200': + description: 'successfully issued BankAccount schema.' content: application/yml: schema: @@ -98,6 +105,7 @@ paths: - common responses: '200': + description: 'successfully issued BankAccountHolderAffirmation schema.' content: application/yml: schema: @@ -110,6 +118,7 @@ paths: - common responses: '200': + description: 'successfully issued BillOfLading schema.' content: application/yml: schema: @@ -122,6 +131,7 @@ paths: - common responses: '200': + description: 'successfully issued BusinessRegistrationAffirmation schema.' content: application/yml: schema: @@ -134,6 +144,7 @@ paths: - common responses: '200': + description: 'successfully issued CBPEntry schema.' content: application/yml: schema: @@ -146,6 +157,7 @@ paths: - common responses: '200': + description: 'successfully issued CBPEntryEntity schema.' content: application/yml: schema: @@ -158,6 +170,7 @@ paths: - common responses: '200': + description: 'successfully issued CBPEntryLineItem schema.' content: application/yml: schema: @@ -170,6 +183,7 @@ paths: - common responses: '200': + description: 'successfully issued CBPEntrySummary schema.' content: application/yml: schema: @@ -182,6 +196,7 @@ paths: - common responses: '200': + description: 'successfully issued CBPEntrySummaryLineItem schema.' content: application/yml: schema: @@ -194,6 +209,7 @@ paths: - common responses: '200': + description: 'successfully issued CBPEntryType86 schema.' content: application/yml: schema: @@ -206,6 +222,7 @@ paths: - common responses: '200': + description: 'successfully issued CBPImporterOfRecord schema.' content: application/yml: schema: @@ -218,6 +235,7 @@ paths: - common responses: '200': + description: 'successfully issued CTPAT schema.' content: application/yml: schema: @@ -230,6 +248,7 @@ paths: - common responses: '200': + description: 'successfully issued CTPATEIPApplication schema.' content: application/yml: schema: @@ -242,6 +261,7 @@ paths: - common responses: '200': + description: 'successfully issued CTPATMember schema.' content: application/yml: schema: @@ -254,6 +274,7 @@ paths: - common responses: '200': + description: 'successfully issued CargoItem schema.' content: application/yml: schema: @@ -266,6 +287,7 @@ paths: - common responses: '200': + description: 'successfully issued CargoLineItem schema.' content: application/yml: schema: @@ -278,6 +300,7 @@ paths: - common responses: '200': + description: 'successfully issued ChargeDeclaration schema.' content: application/yml: schema: @@ -290,6 +313,7 @@ paths: - common responses: '200': + description: 'successfully issued ChemicalProperty schema.' content: application/yml: schema: @@ -302,6 +326,7 @@ paths: - common responses: '200': + description: 'successfully issued CommissionEvent schema.' content: application/yml: schema: @@ -314,6 +339,7 @@ paths: - common responses: '200': + description: 'successfully issued Commodity schema.' content: application/yml: schema: @@ -326,6 +352,7 @@ paths: - common responses: '200': + description: 'successfully issued ConsignmentItem schema.' content: application/yml: schema: @@ -338,6 +365,7 @@ paths: - common responses: '200': + description: 'successfully issued ConsignmentRatingDetail schema.' content: application/yml: schema: @@ -350,6 +378,7 @@ paths: - common responses: '200': + description: 'successfully issued ContactPoint schema.' content: application/yml: schema: @@ -362,6 +391,7 @@ paths: - common responses: '200': + description: 'successfully issued Customer schema.' content: application/yml: schema: @@ -374,6 +404,7 @@ paths: - common responses: '200': + description: 'successfully issued DCSAShippingInstruction schema.' content: application/yml: schema: @@ -386,6 +417,7 @@ paths: - common responses: '200': + description: 'successfully issued DCSATransportDocument schema.' content: application/yml: schema: @@ -398,6 +430,7 @@ paths: - common responses: '200': + description: 'successfully issued DeMinimisShipment schema.' content: application/yml: schema: @@ -410,6 +443,7 @@ paths: - common responses: '200': + description: 'successfully issued DeliverySchedule schema.' content: application/yml: schema: @@ -422,6 +456,7 @@ paths: - common responses: '200': + description: 'successfully issued DeliveryStatement schema.' content: application/yml: schema: @@ -434,6 +469,7 @@ paths: - common responses: '200': + description: 'successfully issued EDDShape schema.' content: application/yml: schema: @@ -446,6 +482,7 @@ paths: - common responses: '200': + description: 'successfully issued EDDShapeMeta schema.' content: application/yml: schema: @@ -458,6 +495,7 @@ paths: - common responses: '200': + description: 'successfully issued Entity schema.' content: application/yml: schema: @@ -470,6 +508,7 @@ paths: - common responses: '200': + description: 'successfully issued EntryNumber schema.' content: application/yml: schema: @@ -482,6 +521,7 @@ paths: - common responses: '200': + description: 'successfully issued Event schema.' content: application/yml: schema: @@ -494,6 +534,7 @@ paths: - common responses: '200': + description: 'successfully issued ExternalResource schema.' content: application/yml: schema: @@ -506,6 +547,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMAAbstractKDE schema.' content: application/yml: schema: @@ -518,6 +560,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMACreatingCTE schema.' content: application/yml: schema: @@ -530,6 +573,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMAFirstReceiverData schema.' content: application/yml: schema: @@ -542,6 +586,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMAGrowingCTE schema.' content: application/yml: schema: @@ -554,6 +599,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMAProduct schema.' content: application/yml: schema: @@ -566,6 +612,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMAReceivingCTE schema.' content: application/yml: schema: @@ -578,6 +625,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMAShipment schema.' content: application/yml: schema: @@ -590,6 +638,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMAShippingCTE schema.' content: application/yml: schema: @@ -602,6 +651,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMATraceabilityLot schema.' content: application/yml: schema: @@ -614,6 +664,7 @@ paths: - common responses: '200': + description: 'successfully issued FSMATransformingCTE schema.' content: application/yml: schema: @@ -626,6 +677,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodDefenseDeficiency schema.' content: application/yml: schema: @@ -638,6 +690,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodDefenseInspection schema.' content: application/yml: schema: @@ -650,6 +703,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodDefenseQuestion schema.' content: application/yml: schema: @@ -662,6 +716,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodGradeInspection schema.' content: application/yml: schema: @@ -674,6 +729,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodGradeInspectionDefect schema.' content: application/yml: schema: @@ -686,6 +742,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodGradeInspectionLot schema.' content: application/yml: schema: @@ -698,6 +755,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodGradeInspectionResult schema.' content: application/yml: schema: @@ -710,6 +768,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodGradeInspectionSample schema.' content: application/yml: schema: @@ -722,6 +781,7 @@ paths: - common responses: '200': + description: 'successfully issued FoodGradeInspectionSampleProperty schema.' content: application/yml: schema: @@ -734,6 +794,7 @@ paths: - common responses: '200': + description: 'successfully issued ForeignChargeDeclaration schema.' content: application/yml: schema: @@ -746,6 +807,7 @@ paths: - common responses: '200': + description: 'successfully issued FreightManifest schema.' content: application/yml: schema: @@ -758,6 +820,7 @@ paths: - common responses: '200': + description: 'successfully issued GAPCorrectiveActionReport schema.' content: application/yml: schema: @@ -770,6 +833,7 @@ paths: - common responses: '200': + description: 'successfully issued GAPInspection schema.' content: application/yml: schema: @@ -782,6 +846,7 @@ paths: - common responses: '200': + description: 'successfully issued GAPLocationCertification schema.' content: application/yml: schema: @@ -794,6 +859,7 @@ paths: - common responses: '200': + description: 'successfully issued GAPRequirementResult schema.' content: application/yml: schema: @@ -806,6 +872,7 @@ paths: - common responses: '200': + description: 'successfully issued GeoCoordinates schema.' content: application/yml: schema: @@ -818,6 +885,7 @@ paths: - common responses: '200': + description: 'successfully issued HouseBillOfLading schema.' content: application/yml: schema: @@ -830,6 +898,7 @@ paths: - common responses: '200': + description: 'successfully issued IATAAirWaybill schema.' content: application/yml: schema: @@ -842,6 +911,7 @@ paths: - common responses: '200': + description: 'successfully issued ImporterSecurityFiling schema.' content: application/yml: schema: @@ -854,6 +924,7 @@ paths: - common responses: '200': + description: 'successfully issued Inbond schema.' content: application/yml: schema: @@ -866,6 +937,7 @@ paths: - common responses: '200': + description: 'successfully issued InspectionReport schema.' content: application/yml: schema: @@ -878,6 +950,7 @@ paths: - common responses: '200': + description: 'successfully issued Inspector schema.' content: application/yml: schema: @@ -890,6 +963,7 @@ paths: - common responses: '200': + description: 'successfully issued Instructions schema.' content: application/yml: schema: @@ -902,6 +976,7 @@ paths: - common responses: '200': + description: 'successfully issued IntellectualPropertyRights schema.' content: application/yml: schema: @@ -914,6 +989,7 @@ paths: - common responses: '200': + description: 'successfully issued IntellectualPropertyRightsAffirmation schema.' content: application/yml: schema: @@ -926,6 +1002,7 @@ paths: - common responses: '200': + description: 'successfully issued IntellectualPropertyRightsLicense schema.' content: application/yml: schema: @@ -938,6 +1015,7 @@ paths: - common responses: '200': + description: 'successfully issued IntentToImport schema.' content: application/yml: schema: @@ -950,6 +1028,7 @@ paths: - common responses: '200': + description: 'successfully issued Invoice schema.' content: application/yml: schema: @@ -962,6 +1041,7 @@ paths: - common responses: '200': + description: 'successfully issued LEIAddress schema.' content: application/yml: schema: @@ -974,6 +1054,7 @@ paths: - common responses: '200': + description: 'successfully issued LEIAuthority schema.' content: application/yml: schema: @@ -986,6 +1067,7 @@ paths: - common responses: '200': + description: 'successfully issued LEIEntity schema.' content: application/yml: schema: @@ -998,6 +1080,7 @@ paths: - common responses: '200': + description: 'successfully issued LEIRegistration schema.' content: application/yml: schema: @@ -1010,6 +1093,7 @@ paths: - common responses: '200': + description: 'successfully issued LaceyActProductDeclaration schema.' content: application/yml: schema: @@ -1022,6 +1106,7 @@ paths: - common responses: '200': + description: 'successfully issued LinkRole schema.' content: application/yml: schema: @@ -1034,6 +1119,7 @@ paths: - common responses: '200': + description: 'successfully issued MapResource schema.' content: application/yml: schema: @@ -1046,6 +1132,7 @@ paths: - common responses: '200': + description: 'successfully issued MasterBillOfLading schema.' content: application/yml: schema: @@ -1058,6 +1145,7 @@ paths: - common responses: '200': + description: 'successfully issued MeasuredProperty schema.' content: application/yml: schema: @@ -1070,6 +1158,7 @@ paths: - common responses: '200': + description: 'successfully issued MeasuredValue schema.' content: application/yml: schema: @@ -1082,6 +1171,7 @@ paths: - common responses: '200': + description: 'successfully issued MechanicalProperty schema.' content: application/yml: schema: @@ -1094,6 +1184,7 @@ paths: - common responses: '200': + description: 'successfully issued MonetaryAmount schema.' content: application/yml: schema: @@ -1106,6 +1197,7 @@ paths: - common responses: '200': + description: 'successfully issued MonthlyAdvanceManifest schema.' content: application/yml: schema: @@ -1118,6 +1210,7 @@ paths: - common responses: '200': + description: 'successfully issued MonthlyDeliveryStatement schema.' content: application/yml: schema: @@ -1130,6 +1223,7 @@ paths: - common responses: '200': + description: 'successfully issued MultiModalBillOfLading schema.' content: application/yml: schema: @@ -1142,6 +1236,7 @@ paths: - common responses: '200': + description: 'successfully issued NAISMADateTime schema.' content: application/yml: schema: @@ -1154,6 +1249,7 @@ paths: - common responses: '200': + description: 'successfully issued NAISMAInfestation schema.' content: application/yml: schema: @@ -1166,6 +1262,7 @@ paths: - common responses: '200': + description: 'successfully issued NAISMAInformationSource schema.' content: application/yml: schema: @@ -1178,6 +1275,7 @@ paths: - common responses: '200': + description: 'successfully issued NAISMALocation schema.' content: application/yml: schema: @@ -1190,6 +1288,7 @@ paths: - common responses: '200': + description: 'successfully issued NAISMARecordLeveldentifiers schema.' content: application/yml: schema: @@ -1202,6 +1301,7 @@ paths: - common responses: '200': + description: 'successfully issued NAISMARecordStatus schema.' content: application/yml: schema: @@ -1214,6 +1314,7 @@ paths: - common responses: '200': + description: 'successfully issued NAISMASubject schema.' content: application/yml: schema: @@ -1226,6 +1327,7 @@ paths: - common responses: '200': + description: 'successfully issued NAISMATaxonomy schema.' content: application/yml: schema: @@ -1238,6 +1340,7 @@ paths: - common responses: '200': + description: 'successfully issued Observation schema.' content: application/yml: schema: @@ -1250,6 +1353,7 @@ paths: - common responses: '200': + description: 'successfully issued OilAndGasDeliveryTicket schema.' content: application/yml: schema: @@ -1262,6 +1366,7 @@ paths: - common responses: '200': + description: 'successfully issued OilAndGasProduct schema.' content: application/yml: schema: @@ -1274,6 +1379,7 @@ paths: - common responses: '200': + description: 'successfully issued Order schema.' content: application/yml: schema: @@ -1286,6 +1392,7 @@ paths: - common responses: '200': + description: 'successfully issued OrderItem schema.' content: application/yml: schema: @@ -1298,6 +1405,7 @@ paths: - common responses: '200': + description: 'successfully issued OrganicCertificate schema.' content: application/yml: schema: @@ -1310,6 +1418,7 @@ paths: - common responses: '200': + description: 'successfully issued OrganicInspection schema.' content: application/yml: schema: @@ -1322,6 +1431,7 @@ paths: - common responses: '200': + description: 'successfully issued OrganicOSPSectionReview schema.' content: application/yml: schema: @@ -1334,6 +1444,7 @@ paths: - common responses: '200': + description: 'successfully issued OrganicProductCertificate schema.' content: application/yml: schema: @@ -1346,6 +1457,7 @@ paths: - common responses: '200': + description: 'successfully issued OrganicReview schema.' content: application/yml: schema: @@ -1358,6 +1470,7 @@ paths: - common responses: '200': + description: 'successfully issued Organization schema.' content: application/yml: schema: @@ -1370,6 +1483,7 @@ paths: - common responses: '200': + description: 'successfully issued PGAShipmentStatus schema.' content: application/yml: schema: @@ -1382,6 +1496,7 @@ paths: - common responses: '200': + description: 'successfully issued PGAShipmentStatusList schema.' content: application/yml: schema: @@ -1394,6 +1509,7 @@ paths: - common responses: '200': + description: 'successfully issued Package schema.' content: application/yml: schema: @@ -1406,6 +1522,7 @@ paths: - common responses: '200': + description: 'successfully issued PackingList schema.' content: application/yml: schema: @@ -1418,6 +1535,7 @@ paths: - common responses: '200': + description: 'successfully issued ParcelDelivery schema.' content: application/yml: schema: @@ -1430,6 +1548,7 @@ paths: - common responses: '200': + description: 'successfully issued PartOfOrder schema.' content: application/yml: schema: @@ -1442,6 +1561,7 @@ paths: - common responses: '200': + description: 'successfully issued Person schema.' content: application/yml: schema: @@ -1454,6 +1574,7 @@ paths: - common responses: '200': + description: 'successfully issued PestDetermination schema.' content: application/yml: schema: @@ -1466,6 +1587,7 @@ paths: - common responses: '200': + description: 'successfully issued PestSample schema.' content: application/yml: schema: @@ -1478,6 +1600,7 @@ paths: - common responses: '200': + description: 'successfully issued Phytosanitary schema.' content: application/yml: schema: @@ -1490,6 +1613,7 @@ paths: - common responses: '200': + description: 'successfully issued Place schema.' content: application/yml: schema: @@ -1502,6 +1626,7 @@ paths: - common responses: '200': + description: 'successfully issued PlantSystemsInspection schema.' content: application/yml: schema: @@ -1514,6 +1639,7 @@ paths: - common responses: '200': + description: 'successfully issued PlantSystemsQuestion schema.' content: application/yml: schema: @@ -1526,6 +1652,7 @@ paths: - common responses: '200': + description: 'successfully issued PostalAddress schema.' content: application/yml: schema: @@ -1538,6 +1665,7 @@ paths: - common responses: '200': + description: 'successfully issued PostmanCollection schema.' content: application/yml: schema: @@ -1550,6 +1678,7 @@ paths: - common responses: '200': + description: 'successfully issued PriceSpecification schema.' content: application/yml: schema: @@ -1562,6 +1691,7 @@ paths: - common responses: '200': + description: 'successfully issued Product schema.' content: application/yml: schema: @@ -1574,6 +1704,7 @@ paths: - common responses: '200': + description: 'successfully issued Purchase schema.' content: application/yml: schema: @@ -1586,6 +1717,7 @@ paths: - common responses: '200': + description: 'successfully issued PurchaseOrder schema.' content: application/yml: schema: @@ -1598,6 +1730,7 @@ paths: - common responses: '200': + description: 'successfully issued Qualification schema.' content: application/yml: schema: @@ -1610,6 +1743,7 @@ paths: - common responses: '200': + description: 'successfully issued QuantitativeValue schema.' content: application/yml: schema: @@ -1622,6 +1756,7 @@ paths: - common responses: '200': + description: 'successfully issued RawMaterial schema.' content: application/yml: schema: @@ -1634,6 +1769,7 @@ paths: - common responses: '200': + description: 'successfully issued RevocationList2020Status schema.' content: application/yml: schema: @@ -1646,6 +1782,7 @@ paths: - common responses: '200': + description: 'successfully issued RoutingInfo schema.' content: application/yml: schema: @@ -1658,6 +1795,7 @@ paths: - common responses: '200': + description: 'successfully issued SIMASteelImportLicense schema.' content: application/yml: schema: @@ -1670,6 +1808,7 @@ paths: - common responses: '200': + description: 'successfully issued SIMASteelImportProductSpecifier schema.' content: application/yml: schema: @@ -1682,6 +1821,7 @@ paths: - common responses: '200': + description: 'successfully issued Scorecard schema.' content: application/yml: schema: @@ -1694,6 +1834,7 @@ paths: - common responses: '200': + description: 'successfully issued SeaCargoManifest schema.' content: application/yml: schema: @@ -1706,6 +1847,7 @@ paths: - common responses: '200': + description: 'successfully issued Seal schema.' content: application/yml: schema: @@ -1718,6 +1860,7 @@ paths: - common responses: '200': + description: 'successfully issued ServiceCharge schema.' content: application/yml: schema: @@ -1730,6 +1873,7 @@ paths: - common responses: '200': + description: 'successfully issued ShippingDetails schema.' content: application/yml: schema: @@ -1742,6 +1886,7 @@ paths: - common responses: '200': + description: 'successfully issued ShippingInstructions schema.' content: application/yml: schema: @@ -1754,6 +1899,7 @@ paths: - common responses: '200': + description: 'successfully issued SoftwareBillOfMaterials schema.' content: application/yml: schema: @@ -1766,6 +1912,7 @@ paths: - common responses: '200': + description: 'successfully issued SteelProduct schema.' content: application/yml: schema: @@ -1778,6 +1925,7 @@ paths: - common responses: '200': + description: 'successfully issued TSCACertification schema.' content: application/yml: schema: @@ -1790,6 +1938,7 @@ paths: - common responses: '200': + description: 'successfully issued Taxonomy schema.' content: application/yml: schema: @@ -1802,6 +1951,7 @@ paths: - common responses: '200': + description: 'successfully issued TemperatureReading schema.' content: application/yml: schema: @@ -1814,6 +1964,7 @@ paths: - common responses: '200': + description: 'successfully issued Template schema.' content: application/yml: schema: @@ -1826,6 +1977,7 @@ paths: - common responses: '200': + description: 'successfully issued Thing schema.' content: application/yml: schema: @@ -1838,6 +1990,7 @@ paths: - common responses: '200': + description: 'successfully issued TraceabilityAPI schema.' content: application/yml: schema: @@ -1850,6 +2003,7 @@ paths: - common responses: '200': + description: 'successfully issued TradeLineItem schema.' content: application/yml: schema: @@ -1862,6 +2016,7 @@ paths: - common responses: '200': + description: 'successfully issued TransferEvent schema.' content: application/yml: schema: @@ -1874,6 +2029,7 @@ paths: - common responses: '200': + description: 'successfully issued TransformEvent schema.' content: application/yml: schema: @@ -1886,6 +2042,7 @@ paths: - common responses: '200': + description: 'successfully issued Transport schema.' content: application/yml: schema: @@ -1898,6 +2055,7 @@ paths: - common responses: '200': + description: 'successfully issued TransportDocument schema.' content: application/yml: schema: @@ -1910,6 +2068,7 @@ paths: - common responses: '200': + description: 'successfully issued TransportEquipment schema.' content: application/yml: schema: @@ -1922,6 +2081,7 @@ paths: - common responses: '200': + description: 'successfully issued TransportEvent schema.' content: application/yml: schema: @@ -1934,6 +2094,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ203ForeignSiteInspection schema.' content: application/yml: schema: @@ -1946,6 +2107,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ309APestInterceptionRecord schema.' content: application/yml: schema: @@ -1958,6 +2120,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ368NoticeOfArrival schema.' content: application/yml: schema: @@ -1970,6 +2133,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ391SpecimensForDetermination schema.' content: application/yml: schema: @@ -1982,6 +2146,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ429FumigationRecord schema.' content: application/yml: schema: @@ -1994,6 +2159,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ449RTemperatureCalibration schema.' content: application/yml: schema: @@ -2006,6 +2172,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ505PlantDeclaration schema.' content: application/yml: schema: @@ -2018,6 +2185,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ519ComplianceAgreement schema.' content: application/yml: schema: @@ -2030,6 +2198,7 @@ paths: - common responses: '200': + description: 'successfully issued USDAPPQ587PlantImportApplication schema.' content: application/yml: schema: @@ -2042,6 +2211,7 @@ paths: - common responses: '200': + description: 'successfully issued USDASC6ExemptCommodity schema.' content: application/yml: schema: @@ -2054,6 +2224,7 @@ paths: - common responses: '200': + description: 'successfully issued USDASpecialtyCrops237AForm schema.' content: application/yml: schema: @@ -2066,6 +2237,7 @@ paths: - common responses: '200': + description: 'successfully issued USMCACertifier schema.' content: application/yml: schema: @@ -2078,6 +2250,7 @@ paths: - common responses: '200': + description: 'successfully issued USMCAClaims schema.' content: application/yml: schema: @@ -2090,6 +2263,7 @@ paths: - common responses: '200': + description: 'successfully issued USMCAProduct schema.' content: application/yml: schema: @@ -2102,6 +2276,7 @@ paths: - common responses: '200': + description: 'successfully issued WebLEI schema.' content: application/yml: schema: @@ -2114,6 +2289,7 @@ paths: - credentials responses: '200': + description: 'successfully issued ActivityPubActorCard schema.' content: application/yml: schema: @@ -2126,6 +2302,7 @@ paths: - credentials responses: '200': + description: 'successfully issued AgricultureCanineCard schema.' content: application/yml: schema: @@ -2138,6 +2315,7 @@ paths: - credentials responses: '200': + description: 'successfully issued BankAccountCredential schema.' content: application/yml: schema: @@ -2150,6 +2328,7 @@ paths: - credentials responses: '200': + description: 'successfully issued BillOfLadingCredential schema.' content: application/yml: schema: @@ -2162,6 +2341,7 @@ paths: - credentials responses: '200': + description: 'successfully issued CBP3461EntryCredential schema.' content: application/yml: schema: @@ -2174,6 +2354,7 @@ paths: - credentials responses: '200': + description: 'successfully issued CBP7501EntrySummaryCredential schema.' content: application/yml: schema: @@ -2186,6 +2367,7 @@ paths: - credentials responses: '200': + description: 'successfully issued CBPEntryType86Credential schema.' content: application/yml: schema: @@ -2198,6 +2380,7 @@ paths: - credentials responses: '200': + description: 'successfully issued CBPSection321DeMinimisCredential schema.' content: application/yml: schema: @@ -2210,6 +2393,7 @@ paths: - credentials responses: '200': + description: 'successfully issued CTPATCertificate schema.' content: application/yml: schema: @@ -2222,6 +2406,7 @@ paths: - credentials responses: '200': + description: 'successfully issued CertificationOfOrigin schema.' content: application/yml: schema: @@ -2234,6 +2419,7 @@ paths: - credentials responses: '200': + description: 'successfully issued CommercialInvoiceCredential schema.' content: application/yml: schema: @@ -2246,6 +2432,7 @@ paths: - credentials responses: '200': + description: 'successfully issued DCSAShippingInstructionCredential schema.' content: application/yml: schema: @@ -2258,6 +2445,7 @@ paths: - credentials responses: '200': + description: 'successfully issued DCSATransportDocumentCredential schema.' content: application/yml: schema: @@ -2270,6 +2458,7 @@ paths: - credentials responses: '200': + description: 'successfully issued DeliveryScheduleCredential schema.' content: application/yml: schema: @@ -2282,6 +2471,7 @@ paths: - credentials responses: '200': + description: 'successfully issued DeliveryStatementCredential schema.' content: application/yml: schema: @@ -2294,6 +2484,7 @@ paths: - credentials responses: '200': + description: 'successfully issued DigitalProductPassportCredential schema.' content: application/yml: schema: @@ -2306,6 +2497,7 @@ paths: - credentials responses: '200': + description: 'successfully issued DigitalProductPassportDataCarrierCredential schema.' content: application/yml: schema: @@ -2318,6 +2510,7 @@ paths: - credentials responses: '200': + description: 'successfully issued EPA35401PesticidesCredential schema.' content: application/yml: schema: @@ -2330,6 +2523,7 @@ paths: - credentials responses: '200': + description: 'successfully issued EPA35401PesticidesPart2Credential schema.' content: application/yml: schema: @@ -2342,6 +2536,7 @@ paths: - credentials responses: '200': + description: 'successfully issued EPA35401PesticidesPart3Credential schema.' content: application/yml: schema: @@ -2354,6 +2549,7 @@ paths: - credentials responses: '200': + description: 'successfully issued EntryNumberCredential schema.' content: application/yml: schema: @@ -2366,6 +2562,7 @@ paths: - credentials responses: '200': + description: 'successfully issued EventCredential schema.' content: application/yml: schema: @@ -2378,6 +2575,7 @@ paths: - credentials responses: '200': + description: 'successfully issued ExampleCredentialWithStatus schema.' content: application/yml: schema: @@ -2390,6 +2588,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FSMACreatingCTECredential schema.' content: application/yml: schema: @@ -2402,6 +2601,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FSMAFirstReceiverDataCredential schema.' content: application/yml: schema: @@ -2414,6 +2614,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FSMAGrowingCTECredential schema.' content: application/yml: schema: @@ -2426,6 +2627,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FSMAReceivingCTECredential schema.' content: application/yml: schema: @@ -2438,6 +2640,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FSMAShippingCTECredential schema.' content: application/yml: schema: @@ -2450,6 +2653,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FSMATransformingCTECredential schema.' content: application/yml: schema: @@ -2462,6 +2666,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FoodDefenseInspectionCredential schema.' content: application/yml: schema: @@ -2474,6 +2679,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FoodGradeInspectionCredential schema.' content: application/yml: schema: @@ -2486,6 +2692,7 @@ paths: - credentials responses: '200': + description: 'successfully issued FreightManifestCredential schema.' content: application/yml: schema: @@ -2498,6 +2705,7 @@ paths: - credentials responses: '200': + description: 'successfully issued GAPInspectionCredential schema.' content: application/yml: schema: @@ -2510,6 +2718,7 @@ paths: - credentials responses: '200': + description: 'successfully issued GS18PrefixLicenseCredential schema.' content: application/yml: schema: @@ -2522,6 +2731,7 @@ paths: - credentials responses: '200': + description: 'successfully issued GS1CompanyPrefixLicenseCredential schema.' content: application/yml: schema: @@ -2534,6 +2744,7 @@ paths: - credentials responses: '200': + description: 'successfully issued GS1DataCredential schema.' content: application/yml: schema: @@ -2546,6 +2757,7 @@ paths: - credentials responses: '200': + description: 'successfully issued GS1DelegationCredential schema.' content: application/yml: schema: @@ -2558,6 +2770,7 @@ paths: - credentials responses: '200': + description: 'successfully issued GS1IdentificationKeyLicenseCredential schema.' content: application/yml: schema: @@ -2570,6 +2783,7 @@ paths: - credentials responses: '200': + description: 'successfully issued GS1KeyCredential schema.' content: application/yml: schema: @@ -2582,6 +2796,7 @@ paths: - credentials responses: '200': + description: 'successfully issued GS1PrefixLicenseCredential schema.' content: application/yml: schema: @@ -2594,6 +2809,7 @@ paths: - credentials responses: '200': + description: 'successfully issued HouseBillOfLadingCredential schema.' content: application/yml: schema: @@ -2606,6 +2822,7 @@ paths: - credentials responses: '200': + description: 'successfully issued IATAAirWaybillCredential schema.' content: application/yml: schema: @@ -2618,6 +2835,7 @@ paths: - credentials responses: '200': + description: 'successfully issued ImporterSecurityFilingCredential schema.' content: application/yml: schema: @@ -2630,6 +2848,7 @@ paths: - credentials responses: '200': + description: 'successfully issued IntellectualPropertyRightsCredential schema.' content: application/yml: schema: @@ -2642,6 +2861,7 @@ paths: - credentials responses: '200': + description: 'successfully issued IntellectualPropertyRightsLicenseCredential schema.' content: application/yml: schema: @@ -2654,6 +2874,7 @@ paths: - credentials responses: '200': + description: 'successfully issued IntentToImportCredential schema.' content: application/yml: schema: @@ -2666,6 +2887,7 @@ paths: - credentials responses: '200': + description: 'successfully issued InventoryRegistrationCredential schema.' content: application/yml: schema: @@ -2678,6 +2900,7 @@ paths: - credentials responses: '200': + description: 'successfully issued MasterBillOfLadingCredential schema.' content: application/yml: schema: @@ -2690,6 +2913,7 @@ paths: - credentials responses: '200': + description: 'successfully issued MexicoEInvoiceCredential schema.' content: application/yml: schema: @@ -2702,6 +2926,7 @@ paths: - credentials responses: '200': + description: 'successfully issued MillTestReportCredential schema.' content: application/yml: schema: @@ -2714,6 +2939,7 @@ paths: - credentials responses: '200': + description: 'successfully issued MonthlyAdvanceManifestCredential schema.' content: application/yml: schema: @@ -2726,6 +2952,7 @@ paths: - credentials responses: '200': + description: 'successfully issued MultiModalBillOfLadingCredential schema.' content: application/yml: schema: @@ -2738,6 +2965,7 @@ paths: - credentials responses: '200': + description: 'successfully issued OilAndGasDeliveryTicketCredential schema.' content: application/yml: schema: @@ -2750,6 +2978,7 @@ paths: - credentials responses: '200': + description: 'successfully issued OilAndGasProductCredential schema.' content: application/yml: schema: @@ -2762,6 +2991,7 @@ paths: - credentials responses: '200': + description: 'successfully issued OrderConfirmationCredential schema.' content: application/yml: schema: @@ -2774,6 +3004,7 @@ paths: - credentials responses: '200': + description: 'successfully issued OrganicCertificateCredential schema.' content: application/yml: schema: @@ -2786,6 +3017,7 @@ paths: - credentials responses: '200': + description: 'successfully issued PGAShipmentStatusCredential schema.' content: application/yml: schema: @@ -2798,6 +3030,7 @@ paths: - credentials responses: '200': + description: 'successfully issued PackingListCredential schema.' content: application/yml: schema: @@ -2810,6 +3043,7 @@ paths: - credentials responses: '200': + description: 'successfully issued PlantSystemsInspectionCredential schema.' content: application/yml: schema: @@ -2822,6 +3056,7 @@ paths: - credentials responses: '200': + description: 'successfully issued PowerOfAttorneyCredential schema.' content: application/yml: schema: @@ -2834,6 +3069,7 @@ paths: - credentials responses: '200': + description: 'successfully issued ProductRegistrationCredential schema.' content: application/yml: schema: @@ -2846,6 +3082,7 @@ paths: - credentials responses: '200': + description: 'successfully issued PurchaseOrderCredential schema.' content: application/yml: schema: @@ -2858,6 +3095,7 @@ paths: - credentials responses: '200': + description: 'successfully issued SIMASteelImportLicenseApplicationCredential schema.' content: application/yml: schema: @@ -2870,6 +3108,7 @@ paths: - credentials responses: '200': + description: 'successfully issued SIMASteelImportLicenseCredential schema.' content: application/yml: schema: @@ -2882,6 +3121,7 @@ paths: - credentials responses: '200': + description: 'successfully issued SeaCargoManifestCredential schema.' content: application/yml: schema: @@ -2894,6 +3134,7 @@ paths: - credentials responses: '200': + description: 'successfully issued ShippingInstructionsCredential schema.' content: application/yml: schema: @@ -2906,6 +3147,7 @@ paths: - credentials responses: '200': + description: 'successfully issued SoftwareBillofMaterialsCredential schema.' content: application/yml: schema: @@ -2918,6 +3160,7 @@ paths: - credentials responses: '200': + description: 'successfully issued TSCACertificationCredential schema.' content: application/yml: schema: @@ -2930,6 +3173,7 @@ paths: - credentials responses: '200': + description: 'successfully issued ThingCredential schema.' content: application/yml: schema: @@ -2942,6 +3186,7 @@ paths: - credentials responses: '200': + description: 'successfully issued USMCACertificationOfOrigin schema.' content: application/yml: schema: @@ -2954,6 +3199,7 @@ paths: - credentials responses: '200': + description: 'successfully issued VerifiableBusinessCard schema.' content: application/yml: schema: @@ -2966,6 +3212,7 @@ paths: - credentials responses: '200': + description: 'successfully issued VerifiablePostmanCollection schema.' content: application/yml: schema: @@ -2978,6 +3225,7 @@ paths: - credentials responses: '200': + description: 'successfully issued VerifiableScorecard schema.' content: application/yml: schema: @@ -2990,6 +3238,7 @@ paths: - credentials responses: '200': + description: 'successfully issued environmentalImpactCredential schema.' content: application/yml: schema: @@ -3002,6 +3251,7 @@ paths: - snippets responses: '200': + description: 'successfully issued BuyerParty schema.' content: application/yml: schema: @@ -3014,6 +3264,7 @@ paths: - snippets responses: '200': + description: 'successfully issued ConsigneeParty schema.' content: application/yml: schema: @@ -3026,6 +3277,7 @@ paths: - snippets responses: '200': + description: 'successfully issued IntentToImportOrganization schema.' content: application/yml: schema: @@ -3038,6 +3290,7 @@ paths: - snippets responses: '200': + description: 'successfully issued IntentToImportPlace schema.' content: application/yml: schema: @@ -3050,6 +3303,7 @@ paths: - snippets responses: '200': + description: 'successfully issued IssuerOrganization schema.' content: application/yml: schema: @@ -3062,6 +3316,7 @@ paths: - snippets responses: '200': + description: 'successfully issued ManufacturerParty schema.' content: application/yml: schema: @@ -3074,6 +3329,7 @@ paths: - snippets responses: '200': + description: 'successfully issued SellerParty schema.' content: application/yml: schema: @@ -3086,6 +3342,7 @@ paths: - snippets responses: '200': + description: 'successfully issued ShipToParty schema.' content: application/yml: schema: @@ -3098,6 +3355,7 @@ paths: - snippets responses: '200': + description: 'successfully issued carrier schema.' content: application/yml: schema: @@ -3110,6 +3368,7 @@ paths: - snippets responses: '200': + description: 'successfully issued consignee schema.' content: application/yml: schema: @@ -3122,6 +3381,7 @@ paths: - snippets responses: '200': + description: 'successfully issued consignor schema.' content: application/yml: schema: @@ -3134,6 +3394,7 @@ paths: - snippets responses: '200': + description: 'successfully issued forwarder schema.' content: application/yml: schema: @@ -3146,6 +3407,7 @@ paths: - snippets responses: '200': + description: 'successfully issued notify schema.' content: application/yml: schema: @@ -3158,6 +3420,7 @@ paths: - snippets responses: '200': + description: 'successfully issued proof schema.' content: application/yml: schema: @@ -3170,6 +3433,7 @@ paths: - workflows responses: '200': + description: 'successfully issued businesscard schema.' content: application/yml: schema: @@ -3182,6 +3446,7 @@ paths: - workflows responses: '200': + description: 'successfully issued cbp-steel-tech-demo-2023 schema.' content: application/yml: schema: @@ -3194,6 +3459,7 @@ paths: - workflows responses: '200': + description: 'successfully issued common-import-credentials schema.' content: application/yml: schema: @@ -3206,6 +3472,7 @@ paths: - workflows responses: '200': + description: 'successfully issued intent-to-import schema.' content: application/yml: schema: @@ -3218,6 +3485,7 @@ paths: - workflows responses: '200': + description: 'successfully issued us-cbp-entry schema.' content: application/yml: schema: @@ -3230,6 +3498,7 @@ paths: - workflows responses: '200': + description: 'successfully issued us-cbp schema.' content: application/yml: schema: @@ -3242,6 +3511,7 @@ paths: - workflows responses: '200': + description: 'successfully issued us-sima-steel-import-license schema.' content: application/yml: schema: @@ -3254,6 +3524,7 @@ paths: - workflows responses: '200': + description: 'successfully issued us-steel-import-classification schema.' content: application/yml: schema: diff --git a/packages/traceability-schemas/scripts/schemas-to-openapi.js b/packages/traceability-schemas/scripts/schemas-to-openapi.js index 14b729b6a..7a4d096db 100644 --- a/packages/traceability-schemas/scripts/schemas-to-openapi.js +++ b/packages/traceability-schemas/scripts/schemas-to-openapi.js @@ -42,6 +42,7 @@ const getEndpointsFromSchemaNames = (tag) => { - ${tag} responses: '200': + description: 'successfully issued ${sname.split('.')[0]} schema.' content: application/yml: schema: @@ -57,7 +58,7 @@ const getEndpointsFromSchemaNames = (tag) => { console.log('🧪 building open api from components directory...'); const template = ` -openapi: 3.0.0 +openapi: 3.1.0 info: title: Traceability Schemas version: 1.0.0 From 6dd6d326022b33a986272b37923665220d73dbc5 Mon Sep 17 00:00:00 2001 From: Mahmoud Alkhraishi Date: Fri, 21 Jun 2024 12:10:24 -0400 Subject: [PATCH 2/2] update ci/cd scripts and add openapi validate --- .github/workflows/cd.yml | 10 +++++----- .github/workflows/ci.yml | 11 +++++++---- package.json | 3 ++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8cd867616..c82dc9409 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -11,12 +11,12 @@ jobs: name: Publish unstable release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Use Node 16 - uses: actions/setup-node@v3 + - name: Use Node 20 + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 20.x cache: 'npm' - name: Install @@ -27,7 +27,7 @@ jobs: - name: Test run: npm run test - + - name: Bundle run: npm run bundle diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3a94a086..35f0b700c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Begin CI... - uses: actions/checkout@v3 - - name: Use Node 16 - uses: actions/setup-node@v3 + uses: actions/checkout@v4 + - name: Use Node 20 + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 20.x cache: 'npm' - name: Install run: npm ci @@ -21,3 +21,6 @@ jobs: - name: Jest run: cd packages/traceability-schemas && npm run test + + - name: validate OpenApi Bundle + run: npm run validate diff --git a/package.json b/package.json index 2eeb50aad..8cbadac97 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "test": "lerna run test", "bundle": "swagger-cli bundle ./docs/openapi/openapi.yml -o ./docs/openapi/openapi.bundled.json -r", "build": "lerna run build", - "serve": "npx serve ./docs" + "serve": "npx serve ./docs", + "validate": "swagger-cli validate ./docs/openapi/openapi.yml" }, "devDependencies": { "eslint": "^8.40.0",