@@ -237,7 +237,7 @@ func TestArazzo_RoundTrip_Success(t *testing.T) {
237237}
238238
239239func TestArazzoUnmarshal_ValidationErrors (t * testing.T ) {
240- data := []byte (`arazzo: 1.0.1
240+ data := []byte (`arazzo: 1.0.2
241241x-test: some-value
242242info:
243243 title: My Workflow
@@ -254,14 +254,14 @@ sourceDescriptions:
254254
255255 assert .Equal (t , []error {
256256 & validation.Error {Line : 1 , Column : 1 , Message : "field workflows is missing" },
257- & validation.Error {Line : 1 , Column : 9 , Message : "Arazzo version must be 1.0.0 " },
257+ & validation.Error {Line : 1 , Column : 9 , Message : "Only Arazzo version 1.0.1 and below is supported " },
258258 & validation.Error {Line : 4 , Column : 3 , Message : "field version is missing" },
259259 & validation.Error {Line : 6 , Column : 5 , Message : "field url is missing" },
260260 & validation.Error {Line : 7 , Column : 11 , Message : "type must be one of [openapi, arazzo]" },
261261 }, validationErrs )
262262
263263 expected := & arazzo.Arazzo {
264- Arazzo : "1.0.1 " ,
264+ Arazzo : "1.0.2 " ,
265265 Info : arazzo.Info {
266266 Title : "My Workflow" ,
267267 Version : "" ,
@@ -307,6 +307,7 @@ func TestArazzo_Mutate_Success(t *testing.T) {
307307 require .NoError (t , err )
308308 require .Empty (t , validationErrs )
309309
310+ a .Arazzo = "1.0.0"
310311 a .Info .Title = "My updated workflow title"
311312 sd := a .SourceDescriptions [0 ]
312313 sd .Extensions .Set ("x-test" , yml .CreateOrUpdateScalarNode (ctx , "some-value" , nil ))
@@ -478,53 +479,49 @@ var stressTests = []struct {
478479 {
479480 name : "Redocly Museum API" ,
480481 args : args {
481- location : "https://raw.githubusercontent.com/Redocly/museum-openapi-example/091a853a0d2467bc4c65bb6f615a33d0a7201747/arazzo/museum-api.arazzo.yaml" ,
482- validationIgnores : []string {
483- "invalid jsonpath expression" , // they have criterion marked as jsonpath but uses a simple condition instead
484- },
482+ location : "https://raw.githubusercontent.com/Redocly/museum-openapi-example/2770b2b2e59832d245c7b0eb0badf6568d7efb53/arazzo/museum-api.arazzo.yaml" ,
485483 },
486484 wantTitle : "Redocly Museum API Test Workflow" ,
487485 },
488486 {
489487 name : "Redocly Museum Tickets" ,
490488 args : args {
491- location : "https://raw.githubusercontent.com/Redocly/museum-openapi-example/091a853a0d2467bc4c65bb6f615a33d0a7201747 /arazzo/museum-tickets.arazzo.yaml" ,
489+ location : "https://raw.githubusercontent.com/Redocly/museum-openapi-example/2770b2b2e59832d245c7b0eb0badf6568d7efb53 /arazzo/museum-tickets.arazzo.yaml" ,
492490 },
493491 wantTitle : "Redocly Museum Tickets Workflow" ,
494492 },
495493 {
496494 name : "Redocly Warp API" ,
497495 args : args {
498- // TODO line 25 report inconsistency with spec and value
499- location : "https://raw.githubusercontent.com/Redocly/warp-single-sidebar/be5f885db3cdd9c595f9a7e724c04e9f6a0b70dd/apis/arazzo.yaml" ,
496+ location : "https://raw.githubusercontent.com/Redocly/warp-single-sidebar/b78fc09da52d7755e92e1bc8f990edd37421cbde/apis/arazzo.yaml" ,
500497 },
501498 wantTitle : "Warp API" ,
502499 },
503500 {
504501 name : "Arazzo Extended Parameters Example" ,
505502 args : args {
506- location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/977f586da14b65bd8e612b763267b8b728749e52 /examples/1.0.0/ExtendedParametersExample.arazzo.yaml" ,
503+ location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/23852b8b0d13ab1e3288a57a990611ffed45ab5d /examples/1.0.0/ExtendedParametersExample.arazzo.yaml" ,
507504 },
508505 wantTitle : "Public Zoo API" ,
509506 },
510507 {
511508 name : "Arazzo FAPI-PAR Example" ,
512509 args : args {
513- location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/977f586da14b65bd8e612b763267b8b728749e52 /examples/1.0.0/FAPI-PAR.arazzo.yaml" ,
510+ location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/23852b8b0d13ab1e3288a57a990611ffed45ab5d /examples/1.0.0/FAPI-PAR.arazzo.yaml" ,
514511 },
515512 wantTitle : "PAR, Authorization and Token workflow" ,
516513 },
517514 {
518515 name : "Arazzo Login and Retrieve Pets Example" ,
519516 args : args {
520- location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/977f586da14b65bd8e612b763267b8b728749e52 /examples/1.0.0/LoginAndRetrievePets.arazzo.yaml" ,
517+ location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/23852b8b0d13ab1e3288a57a990611ffed45ab5d /examples/1.0.0/LoginAndRetrievePets.arazzo.yaml" ,
521518 },
522519 wantTitle : "A pet purchasing workflow" ,
523520 },
524521 {
525522 name : "Arazzo BNPL Example" ,
526523 args : args {
527- location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/977f586da14b65bd8e612b763267b8b728749e52 /examples/1.0.0/bnpl-arazzo.yaml" ,
524+ location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/23852b8b0d13ab1e3288a57a990611ffed45ab5d /examples/1.0.0/bnpl-arazzo.yaml" ,
528525 validationIgnores : []string {
529526 "$response.headers.Location" , // doc should be referencing `$response.header.Location`
530527 },
@@ -534,18 +531,14 @@ var stressTests = []struct {
534531 {
535532 name : "Arazzo OAuth Example" ,
536533 args : args {
537- location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/977f586da14b65bd8e612b763267b8b728749e52 /examples/1.0.0/oauth.arazzo.yaml" ,
534+ location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/23852b8b0d13ab1e3288a57a990611ffed45ab5d /examples/1.0.0/oauth.arazzo.yaml" ,
538535 },
539536 wantTitle : "Example OAuth service" ,
540537 },
541538 {
542539 name : "Arazzo Pet Coupons Example" ,
543540 args : args {
544- location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/977f586da14b65bd8e612b763267b8b728749e52/examples/1.0.0/pet-coupons.arazzo.yaml" ,
545- validationIgnores : []string {
546- "$outputs[0]" , // legit issue trying to reference outputs by index
547- "$workflow_order_id" , // legit issue trying to reference workflow_order_id
548- },
541+ location : "https://raw.githubusercontent.com/OAI/Arazzo-Specification/23852b8b0d13ab1e3288a57a990611ffed45ab5d/examples/1.0.0/pet-coupons.arazzo.yaml" ,
549542 },
550543 wantTitle : "Petstore - Apply Coupons" ,
551544 },
@@ -582,7 +575,7 @@ var stressTests = []struct {
582575 {
583576 name : "Itarazzo Client Pet Store Example" ,
584577 args : args {
585- location : "https://raw.githubusercontent.com/leidenheit/itarazzo-client/b744ca1ca3a036964ae30be601f10a25b14dc52d /src/test/resources/pet-store.arazzo.yaml" ,
578+ location : "https://raw.githubusercontent.com/leidenheit/itarazzo-client/b3c126d28bf80ae7d74861c08509be33b83c5ddf /src/test/resources/pet-store.arazzo.yaml" ,
586579 validationIgnores : []string {
587580 "jsonpointer must start with /: $.status" , // legit issues TODO: improve the error returned as it is wrong
588581 "jsonpointer must start with /: $.id" , // legit issues TODO: improve the error returned as it is wrong
@@ -593,15 +586,14 @@ var stressTests = []struct {
593586 {
594587 name : "Ritza build-a-bot workflow" ,
595588 args : args {
596- location : "https://raw.githubusercontent.com/ritza-co/e2e-testing-arazzo/c0615c3708a1e4c0fcaeb79edae78ddc4eb5ba82/arazzo.yaml" ,
597- validationIgnores : []string {},
589+ location : "https://raw.githubusercontent.com/ritza-co/e2e-testing-arazzo/c0615c3708a1e4c0fcaeb79edae78ddc4eb5ba82/arazzo.yaml" ,
598590 },
599591 wantTitle : "Build-a-Bot Workflow" ,
600592 },
601593 {
602594 name : " API-Flows adyen-giving workflow" ,
603595 args : args {
604- location : "https://raw.githubusercontent.com/API-Flows/openapi-workflow-registry/3d85d79232fa8f42993b2f5bd47e273b9369dc2d /root/adyen/adyen-giving.yaml" ,
596+ location : "https://raw.githubusercontent.com/API-Flows/openapi-workflow-registry/75c237ce1b155ba9f8dc7f065759df7ae1cbbbe5 /root/adyen/adyen-giving.yaml" ,
605597 validationIgnores : []string {
606598 "in must be one of [path, query, header, cookie] but was body" ,
607599 },
@@ -611,25 +603,23 @@ var stressTests = []struct {
611603 {
612604 name : "API-Flows simple workflow" ,
613605 args : args {
614- location : "https://raw.githubusercontent.com/API-Flows/openapi-workflow-parser/6b28ba4def262969c5a96bc54d08433e6c336643/src/test/resources/1.0.0/simple.workflow.yaml" ,
615- validationIgnores : []string {},
606+ location : "https://raw.githubusercontent.com/API-Flows/openapi-workflow-parser/6b28ba4def262969c5a96bc54d08433e6c336643/src/test/resources/1.0.0/simple.workflow.yaml" ,
616607 },
617608 wantTitle : "simple" ,
618609 },
619- // Disabled for now as it is currently failing round tripping due to missing conditions
620- // {
621- // name: "Kartikhub swap tokens workflow",
622- // args: args{
623- // location: "https://raw.githubusercontent.com/Kartikhub/web3-basics/d95bc51bb935ef07d627e52c6fdfe18aaea69e18/swap-react/docs/swap-transaction-arazzo.yaml",
624- // validationIgnores: []string{ // All valid issues
625- // "field condition is missing",
626- // "condition is required",
627- // "field value is missing",
628- // "expression is not valid, must begin with $",
629- // },
630- // },
631- // wantTitle: "Swap Tokens",
632- // },
610+ {
611+ name : "Kartikhub swap tokens workflow" ,
612+ args : args {
613+ location : "https://raw.githubusercontent.com/Kartikhub/web3-basics/be13fa7e6fdf386eef08bba2843d4a8b615561b9/swap-react/docs/swap-transaction-arazzo.yaml" ,
614+ validationIgnores : []string { // All valid issues
615+ "field condition is missing" ,
616+ "condition is required" ,
617+ "field value is missing" ,
618+ "expression is not valid, must begin with $" ,
619+ },
620+ },
621+ wantTitle : "Swap Tokens" ,
622+ },
633623}
634624
635625func TestArazzo_StressTests_Validate (t * testing.T ) {
0 commit comments