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-12814] Make schema more flexible, don't enforce additionalProperties: false #6640

Merged

Conversation

titpetric
Copy link
Contributor

@titpetric titpetric commented Oct 15, 2024

User description

TT-12814
Summary Make OAS JSON schema more flexible (do not enforce additionalProperties)
Type Bug Bug
Status In Dev
Points N/A
Labels -

https://tyktech.atlassian.net/browse/TT-12814


PR Type

Enhancement


Description

  • Removed additionalProperties: false from multiple object definitions in the JSON schema to enhance flexibility.
  • This change allows additional properties in the schema, making it more compatible and less strict.

Changes walkthrough 📝

Relevant files
Enhancement
x-tyk-api-gateway.json
Relax schema strictness by removing `additionalProperties: false`

apidef/oas/schema/x-tyk-api-gateway.json

  • Removed additionalProperties: false from multiple object definitions.
  • Enhanced flexibility of the JSON schema by allowing additional
    properties.
  • +1/-73   

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

    @buger
    Copy link
    Member

    buger commented Oct 15, 2024

    I'm a bot and I 👍 this PR title. 🤖

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

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

    Schema Flexibility
    The removal of 'additionalProperties: false' across various schema definitions significantly increases the flexibility of the JSON schema, allowing for unspecified properties. This change should be carefully reviewed to ensure it does not introduce unintended side effects or security issues, especially in environments where strict schema validation was previously relied upon to prevent incorrect configurations.

    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @titpetric titpetric requested a review from lghiur October 15, 2024 11:24
    Copy link
    Contributor

    API Changes

    no api changes detected

    Copy link

    Quality Gate Failed Quality Gate failed

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

    See analysis details on SonarCloud

    @titpetric titpetric merged commit 35500ee into master Oct 15, 2024
    28 of 40 checks passed
    @titpetric titpetric deleted the fix/tt-12814/relax-schema-strictness-for-compatibility branch October 15, 2024 12:52
    @titpetric
    Copy link
    Contributor Author

    /release to release-5.3

    Copy link

    tykbot bot commented Oct 15, 2024

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

    tykbot bot pushed a commit that referenced this pull request Oct 15, 2024
    …ies: false (#6640)
    
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-12814"
    title="TT-12814" target="_blank">TT-12814</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
    <td>Make OAS JSON schema more flexible (do not enforce
    additionalProperties)</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Bug"
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium"
    />
            Bug
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>In Dev</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
          <td>-</td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    https://tyktech.atlassian.net/browse/TT-12814
    
    ___
    
    Enhancement
    
    ___
    
    - Removed `additionalProperties: false` from multiple object definitions
    in the JSON schema to enhance flexibility.
    - This change allows additional properties in the schema, making it more
    compatible and less strict.
    
    ___
    
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Relax schema
    strictness by removing `additionalProperties:
    false`</code></dd></summary>
    <hr>
    
    apidef/oas/schema/x-tyk-api-gateway.json
    
    <li>Removed <code>additionalProperties: false</code> from multiple
    object definitions.<br> <li> Enhanced flexibility of the JSON schema by
    allowing additional <br>properties.<br>
    
    </details>
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6640/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+1/-73</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    Co-authored-by: Tit Petric <tit@tyk.io>
    
    (cherry picked from commit 35500ee)
    Copy link

    tykbot bot commented Oct 15, 2024

    @titpetric Succesfully merged PR

    titpetric pushed a commit that referenced this pull request Oct 15, 2024
    …nforce additionalProperties: false (#6640) (#6641)
    
    [TT-12814] Make schema more flexible, don't enforce
    additionalProperties: false (#6640)
    
    ### **User description**
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-12814"
    title="TT-12814" target="_blank">TT-12814</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
    <td>Make OAS JSON schema more flexible (do not enforce
    additionalProperties)</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Bug"
    
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium"
    />
            Bug
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>In Dev</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
          <td>-</td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    https://tyktech.atlassian.net/browse/TT-12814
    
    
    ___
    
    ### **PR Type**
    Enhancement
    
    
    ___
    
    ### **Description**
    - Removed `additionalProperties: false` from multiple object definitions
    in the JSON schema to enhance flexibility.
    - This change allows additional properties in the schema, making it more
    compatible and less strict.
    
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>x-tyk-api-gateway.json</strong><dd><code>Relax schema
    strictness by removing `additionalProperties:
    false`</code></dd></summary>
    <hr>
    
    apidef/oas/schema/x-tyk-api-gateway.json
    
    <li>Removed <code>additionalProperties: false</code> from multiple
    object definitions.<br> <li> Enhanced flexibility of the JSON schema by
    allowing additional <br>properties.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    
    href="https://github.com/TykTechnologies/tyk/pull/6640/files#diff-78828969c0c04cc1a776dfc93a8bad3c499a8c83e6169f83e96d090bed3e7dd0">+1/-73</a>&nbsp;
    &nbsp; </td>
    
    </tr>                    
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    Co-authored-by: Tit Petric <tit@tyk.io>
    
    [TT-12814]:
    https://tyktech.atlassian.net/browse/TT-12814?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    
    Co-authored-by: Tit Petric <tit@tyk.io>
    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.

    3 participants