Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
TT-12269 Remove api_definition field from dump command's output for…
Browse files Browse the repository at this point in the history
… OAS APIs (#158)

* Removes 'api_definition' field from the API Definitions dumped from Tyk
IF API Definition represents OAS APIs. The reason of this change is that
`api_definition` field in the output of OAS is redundant for OAS APIs
which only needs `oas` field.

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* remove api_definition while printing the file

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* parse API ID from OAS API spec if the API is defined in OAS format

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Parse OAS APIs along with classic APIs while fetching resources from
TykSpec

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Update cmd/dump.go

Co-authored-by: Komal Sukhani <komaldsukhani@gmail.com>

* Update cmd/dump.go

Co-authored-by: Komal Sukhani <komaldsukhani@gmail.com>

* remove redundant copy operation while writing OAS outputs to file

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Add helper functions to fetch configurations based on API type (classic
or OAS)

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* allow users to specify wanted oas apis

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* allow users to dump specific oas-apis

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* fetch OAS API category

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* add new flag --oas-apis to perform operation on certain OAS API Definition

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* fix --apis flag for publisher and add --oas-apis for publisher

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* use new helper methods to set API information regardless of API type

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* remove extra check to verify if the API is OAS

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* set apidefinition fields based on tykspec

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* update oas categories regardless of the length of the categories array in the definition stored locally

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Remove `oas-apis` flag from Sync command

* update tyk deps to v5.4.0

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* Change tyk-sync help message

* Update dump command help

* Update help of publish command

* Update help of Sync command

* Update help of update command

* Some minor updates

* Update message for secret flag

* update help to Help in README.md

* Check only `is_oas` field while separating out OAS APIs

* Set OAS field to nil before dumping

* Update cmd/dump.go

Co-authored-by: Burak Sekili <buraksekili@gmail.com>

* do not respect OAS field while validating api type

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

* do not check for err while setting up args

Signed-off-by: Burak Sekili <buraksekili@gmail.com>

---------

Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Co-authored-by: Komal Sukhani <komaldsukhani@gmail.com>
Co-authored-by: bojantyk <bojan@tyk.io>
Co-authored-by: Olalekan Odukoya <odukoyaonline@gmail.com>
Co-authored-by: Ilija Bojanovic <ilijabojanovic@gmail.com>
  • Loading branch information
5 people authored Jul 2, 2024
1 parent 2637aef commit 03b4aed
Show file tree
Hide file tree
Showing 15 changed files with 482 additions and 194 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Available Commands:
version This command will show the current Tyk-Sync version

Flags:
-h, --help help for tyk-sync
-h, --help Help for tyk-sync

Use "tyk-sync [command] --help" for more information about a command.
```
Expand Down
2 changes: 1 addition & 1 deletion cli-publisher/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (p *DashboardPublisher) SyncAPIs(apiDefs []objects.DBApiDefinition) error {
}

newDef := a
newDef.OrgID = p.OrgOverride
newDef.SetOrgID(p.OrgOverride)
fixedDefs[i] = newDef
}

Expand Down
Loading

0 comments on commit 03b4aed

Please sign in to comment.