-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add tests to verify yaml conversions work #6819
Conversation
A JIRA Issue ID is missing from your branch name, PR title and PR description! 🦄 Your branch: exp/yaml-conversions Your PR title: Add tests to verify yaml conversions work Your PR description: DescriptionRelated IssueMotivation and ContextHow This Has Been TestedScreenshots (if appropriate)Types of changes
Checklist
If this is your first time contributing to this repository - welcome! Please refer to jira-lint to get started. Without the JIRA Issue ID in your branch name you would lose out on automatic updates to JIRA via SCM; some GitHub status checks might fail. Valid sample branch names:‣ feature/shiny-new-feature--mojo-10' |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
API Changes no api changes detected |
PR Code Suggestions ✨Explore these optional code suggestions:
|
e1e8ad4
to
1c4cbdf
Compare
Quality Gate failedFailed conditions |
User description
Description
This PR adds a test to verify that no additional yaml struct tags aren't required on OAS structs to support yaml while defining Tyk OAS APIs.
kin-openapi supports parsing yaml openapi specifications making use of json struct tags.
kin-openapi/go.mod at cea0a13b906a708102947f95b9b09d631ff60976 · getkin/kin-openapi it can be seen that kin-openapi is using GitHub - oasdiff/yaml: A better way to marshal and unmarshal YAML in Golang which explains here that it converts yaml ↔︎ json internally. This means we don’t have to have additional struct tags for yaml.
Related Issue
https://tyktech.atlassian.net/browse/TT-13783
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
PR Type
Tests, Enhancement
Description
Added a new test
TestYaml
to validate YAML and JSON conversions.Introduced dependency on
github.com/oasdiff/yaml
for YAML handling.Updated
go.mod
andgo.sum
to include new YAML-related dependencies.Enhanced test coverage for OpenAPI and Tyk extension integration.
Changes walkthrough 📝
oas_test.go
Added `TestYaml` for YAML and JSON conversion validation
apidef/oas/oas_test.go
TestYaml
for YAML and JSON conversion.yaml.JSONToYAML
for JSON to YAML conversion.go.mod
Updated dependencies for YAML handling
go.mod
github.com/oasdiff/yaml
as a direct dependency.github.com/oasdiff/yaml3
as an indirect dependency.go.sum
Updated checksums for new YAML dependencies
go.sum
github.com/oasdiff/yaml
andgithub.com/oasdiff/yaml3
.