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

fix(schema): deprecated shorthand fields precedence #13486

Merged
merged 2 commits into from
Aug 12, 2024

Commits on Aug 12, 2024

  1. chore(schema): use kong.tools.table instead of tablex, and localize s…

    …ome functions
    
    Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
    bungle committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    b50cf86 View commit details
    Browse the repository at this point in the history
  2. fix(schema): deprecated shorthand fields precedence

    ### Summary
    
    The shorthand fields e.g. as used in (the url is a shorthand) take
    precedence:
    ```
    http PUT :8001/services/test url=http://test.org/ port=2345
    ```
    
    That means that `port=2345` will be overwritten by http default
    port of `80` that is implicit in shorthand field `url`.
    
    This is how it has been for a long long time.
    
    In PR #12686 we added `deprecation` field to shorthand fields definition.
    
    Some of our automatic migrations without database migrations magic use
    this functionality, but the precedence there does not good:
    
    ```
    http -f PUT :8001/plugins/x name=x config.new=test config.old=should_be_ignored
    ```
    
    In above the `config.old` is a shorthand field with a deprecation property.
    Thus it should not overwrite the `config.new`, but in current code base it
    does. This PR changes it so that it doesn't do it anymore.
    
    KAG-5134 and https://kongstrong.slack.com/archives/C07AQH7SAF8/p1722589141558609
    
    Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
    bungle committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    c8b1604 View commit details
    Browse the repository at this point in the history