Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TT-10358] Add fallback to default version OAS support #5679

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

furkansenharputlu
Copy link
Contributor

@furkansenharputlu furkansenharputlu self-assigned this Oct 25, 2023
@sweep-ai
Copy link

sweep-ai bot commented Oct 25, 2023

Apply Sweep Rules to your PR?

  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the tests/ directory.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.

@furkansenharputlu furkansenharputlu force-pushed the feature/fallback-to-default-version branch from e42f41a to a2a3f4e Compare October 25, 2023 23:36
@furkansenharputlu furkansenharputlu force-pushed the feature/oas-fallback-to-default branch from 73b8f92 to d526ee4 Compare October 25, 2023 23:37
apidef/oas/root.go Outdated Show resolved Hide resolved
@furkansenharputlu furkansenharputlu force-pushed the feature/oas-fallback-to-default branch from d526ee4 to e6154a7 Compare October 26, 2023 11:00
@furkansenharputlu furkansenharputlu changed the title [TT-10358] Feature/oas fallback to default [TT-10358] Add fallback to default version OAS support Oct 26, 2023
Base automatically changed from feature/fallback-to-default-version to master October 26, 2023 11:32
@github-actions
Copy link
Contributor

github-actions bot commented Oct 26, 2023

API Changes

--- prev.txt	2023-10-30 07:17:56.981527920 +0000
+++ current.txt	2023-10-30 07:17:52.165385089 +0000
@@ -3857,6 +3857,10 @@
 	Versions []VersionToID `bson:"versions" json:"versions"` // required
 	// StripVersioningData is a boolean flag, if set to `true`, the API responses will be stripped of versioning data.
 	StripVersioningData bool `bson:"stripVersioningData,omitempty" json:"stripVersioningData,omitempty"`
+	// FallbackToDefault controls the behaviour of Tyk when a versioned API is called with a nonexistent version name.
+	// If set to `true` then the default API version will be invoked; if set to `false` Tyk will return an HTTP 404
+	// `This API version does not seem to exist` error in this scenario.
+	FallbackToDefault bool `bson:"fallbackToDefault,omitempty" json:"fallbackToDefault,omitempty"`
 }
     Versioning holds configuration for API versioning.
 

@buger
Copy link
Member

buger commented Oct 26, 2023

API tests result: success
Branch used: refs/pull/5679/merge
Commit: 1f1f3e3
Triggered by: pull_request (@furkansenharputlu)
Execution page

@furkansenharputlu furkansenharputlu force-pushed the feature/oas-fallback-to-default branch from 1f1f3e3 to 17707a8 Compare October 26, 2023 12:08
@TykTechnologies TykTechnologies deleted a comment from github-actions bot Oct 26, 2023
@furkansenharputlu furkansenharputlu force-pushed the feature/oas-fallback-to-default branch from 17707a8 to 39efb84 Compare October 26, 2023 12:09
@TykTechnologies TykTechnologies deleted a comment from github-actions bot Oct 26, 2023
Copy link
Contributor

@andyo-tyk andyo-tyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested rewording of the GoDocs comment

@furkansenharputlu furkansenharputlu force-pushed the feature/oas-fallback-to-default branch 2 times, most recently from 99a531b to f138f07 Compare October 30, 2023 07:09
@furkansenharputlu furkansenharputlu enabled auto-merge (squash) October 30, 2023 07:10
@furkansenharputlu furkansenharputlu requested review from andyo-tyk and removed request for andyo-tyk October 30, 2023 07:11
@TykTechnologies TykTechnologies deleted a comment from github-actions bot Oct 30, 2023
@TykTechnologies TykTechnologies deleted a comment from github-actions bot Oct 30, 2023
@TykTechnologies TykTechnologies deleted a comment from buger Oct 30, 2023
@TykTechnologies TykTechnologies deleted a comment from buger Oct 30, 2023
@TykTechnologies TykTechnologies deleted a comment from sonarqubecloud bot Oct 30, 2023
@TykTechnologies TykTechnologies deleted a comment from buger Oct 30, 2023
@furkansenharputlu furkansenharputlu force-pushed the feature/oas-fallback-to-default branch from f138f07 to 576fa89 Compare October 30, 2023 07:15
@furkansenharputlu furkansenharputlu force-pushed the feature/oas-fallback-to-default branch from 576fa89 to 3430ca4 Compare October 30, 2023 07:17
@TykTechnologies TykTechnologies deleted a comment from github-actions bot Oct 30, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@buger
Copy link
Member

buger commented Oct 30, 2023

API tests result: success
Branch used: refs/pull/5679/merge
Commit: f138f07
Triggered by: pull_request (@furkansenharputlu)
Execution page

@buger
Copy link
Member

buger commented Oct 30, 2023

API tests result: success
Branch used: refs/pull/5679/merge
Commit: 99a531b
Triggered by: pull_request (@furkansenharputlu)
Execution page

@buger
Copy link
Member

buger commented Oct 30, 2023

API tests result: success
Branch used: refs/pull/5679/merge
Commit: 576fa89
Triggered by: pull_request (@furkansenharputlu)
Execution page

@buger
Copy link
Member

buger commented Oct 30, 2023

API tests result: success
Branch used: refs/pull/5679/merge
Commit: 3430ca4
Triggered by: pull_request (@furkansenharputlu)
Execution page

Copy link
Contributor

@andyo-tyk andyo-tyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - looks good.

@furkansenharputlu furkansenharputlu merged commit 7c09214 into master Oct 30, 2023
21 checks passed
@furkansenharputlu furkansenharputlu deleted the feature/oas-fallback-to-default branch October 30, 2023 09:48
@furkansenharputlu
Copy link
Contributor Author

/release to release-5.2

@tykbot
Copy link

tykbot bot commented Oct 30, 2023

Working on it! Note that it can take a few minutes.

@tykbot
Copy link

tykbot bot commented Oct 30, 2023

@furkansenharputlu Succesfully merged PR

buger added a commit that referenced this pull request Oct 30, 2023
sredxny added a commit that referenced this pull request Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants