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-13716]change external oas ref to a local copy in gateway #6758

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yurisasuke
Copy link
Member

@yurisasuke yurisasuke commented Dec 10, 2024

User description

TT-13716
Summary The external OAS we use for tyk oas api return 404 in tyk gateway
Type Story Story
Status In Code Review
Points N/A
Labels -

TT-13716

The external ref https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json returns error 404.

To fix this we have changed from an external ref to a local schema that is saved in the gateway. This will help us have control of the schema.
We have changed https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json to https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json


PR Type

Bug fix


Description

  • Fixed an issue where the external OpenAPI schema reference URL returned a 404 error by replacing it with a local schema URL.
  • Updated .redocly.lint-ignore.yaml to use the new local schema URL.
  • Modified swagger.yml to replace all instances of the external schema reference with the local schema URL across multiple API paths.
  • Ensured consistent usage of the local schema URL to improve reliability and control over the schema.

Changes walkthrough 📝

Relevant files
Bug fix
.redocly.lint-ignore.yaml
Replace external OpenAPI schema reference with local schema URL

.redocly.lint-ignore.yaml

  • Updated the external OpenAPI schema reference URL to a local schema
    URL.
  • Ensured the new local schema URL is used consistently in the file.
  • +1/-1     
    swagger.yml
    Update OpenAPI schema references in API definitions           

    swagger.yml

  • Replaced multiple instances of the external OpenAPI schema reference
    URL with a local schema URL.
  • Updated schema references in various API paths to use the local
    schema.
  • +6/-6     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @buger
    Copy link
    Member

    buger commented Dec 10, 2024

    Let's make that PR title a 💯 shall we? 💪

    Your PR title and story title look slightly different. Just checking in to know if it was intentional!

    Story Title The external OAS we use for tyk oas api return 404 in tyk gateway
    PR Title [TT-13716]change external oas ref to a local copy

    Check out this guide to learn more about PR best-practices.

    Copy link
    Contributor

    Swagger Changes

    
    
      
      
      
      
      
      
      
      
      
      
        
        
        
        
        
        
        
        
         _        __  __
       _| |_   _ / _|/ _|  between swagger-prev.yml
      + one list entry added:
      + one list entry added:
      + one list entry added:
      + one list entry added:
      - one list entry removed:
      - one list entry removed:
      - one list entry removed:
      - one list entry removed:
      ± value change
      ± value change
     / _' | | | | |_| |_       and swagger-current.yml
     \__,_|\__, |_| |_|   returned six differences
    paths./tyk/apis/oas.get.responses.200.content.application/json.schema.items.allOf
    paths./tyk/apis/oas.post.requestBody.content.application/json.schema.allOf
    paths./tyk/apis/oas/import.post.requestBody.content.application/json.schema.$ref
    paths./tyk/apis/oas/{apiID}.get.responses.200.content.application/json.schema.allOf
    paths./tyk/apis/oas/{apiID}.patch.requestBody.content.application/json.schema.$ref
    paths./tyk/apis/oas/{apiID}.put.requestBody.content.application/json.schema.allOf
    | (_| | |_| |  _|  _|

    Copy link
    Contributor

    API Changes

    no api changes detected

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    URL Validation
    Ensure that the new URL for the OAS schema is accessible and valid as it replaces the previous URL which was returning a 404 error.

    Schema Consistency
    Verify that the new local OAS schema is consistent with the previously used external schema to avoid potential discrepancies in API behavior.

    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Copy link

    Quality Gate Failed Quality Gate failed

    Failed conditions
    0.0% Coverage on New Code (required ≥ 80%)

    See analysis details on SonarQube Cloud

    @yurisasuke yurisasuke requested a review from lghiur December 10, 2024 11:46
    @yurisasuke yurisasuke changed the title [TT-13716]change external oas ref to a local copy [TT-13716]change external oas ref to a local copy in tyk gateway Dec 10, 2024
    @yurisasuke yurisasuke changed the title [TT-13716]change external oas ref to a local copy in tyk gateway [TT-13716]change external oas ref to a local copy in gateway Dec 10, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants