Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/file_openapi2kong.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var (
cmdO2KignoreSecurityError bool
cmdO2KignoreCircularRefs bool
cmdO2KskipRouteByHeader bool
cmdO2KreuseService bool
)

// Executes the CLI command "openapi2kong"
Expand All @@ -50,6 +51,7 @@ func executeOpenapi2Kong(cmd *cobra.Command, _ []string) error {
IgnoreSecurityErrors: cmdO2KignoreSecurityError,
IgnoreCircularRefs: cmdO2KignoreCircularRefs,
SkipRouteByHeader: cmdO2KskipRouteByHeader,
ReuseServices: cmdO2KreuseService,
}

trackInfo := deckformat.HistoryNewEntry("openapi2kong")
Expand Down Expand Up @@ -120,6 +122,9 @@ The output will be targeted at Kong version 3.x.
openapi2kongCmd.Flags().BoolVar(&cmdO2KskipRouteByHeader, "skip-route-by-header", false,
"skip generation of separate route for each required header parameter enum value.\n"+
"When set, generates a single route per operation.")
openapi2kongCmd.Flags().BoolVar(&cmdO2KreuseService, "reuse-services", false,
"reuse existing Kong services when multiple paths share the same backend URL.\n"+
"When set, deduplicates services by checking host, protocol, port, and path.")

return openapi2kongCmd
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/ettle/strcase v0.2.0
github.com/fatih/color v1.19.0
github.com/google/go-cmp v0.7.0
github.com/kong/go-apiops v0.4.1
github.com/kong/go-apiops v0.4.2
github.com/kong/go-database-reconciler v1.38.0
github.com/kong/go-kong v0.75.1
github.com/mitchellh/go-homedir v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kong/go-apiops v0.4.1 h1:jVE7O2wSwrmV/meppKRxst9ny+aASJlwj7zma+9pbzc=
github.com/kong/go-apiops v0.4.1/go.mod h1:Xt99d90LallLVwYJAGaufiNbBdsK0KKboe7gR4Ryths=
github.com/kong/go-apiops v0.4.2 h1:t+k42WVdxm5xOKsKTkkTIKK6l2QAhTerWqRa5muZVhM=
github.com/kong/go-apiops v0.4.2/go.mod h1:Xt99d90LallLVwYJAGaufiNbBdsK0KKboe7gR4Ryths=
github.com/kong/go-database-reconciler v1.38.0 h1:KecRJLDRMrH/r/BTORQ17x4coZBOv8vKXTP/K9rlVzg=
github.com/kong/go-database-reconciler v1.38.0/go.mod h1:4YhUoBTMO5smJ0BuWaSfxknbhjrKx9Cg4hvUMR2EW8M=
github.com/kong/go-kong v0.75.1 h1:2W4bZQUvXYGsZ7PvbZKkWnjrZmEiKueSY1yf6xv2jwY=
Expand Down
Loading