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

feat(db): add entity_checks for /schema endpoint #11108

Merged
merged 3 commits into from
Jul 11, 2023

Conversation

jschmid1
Copy link
Contributor

@jschmid1 jschmid1 commented Jun 23, 2023

Summary

The /schemas/{plugins,$daos} endpoint now not only returns fields, but also any canonical entity_checks that can't be expressed otherwise within the field validators themselves.

We do not include custom_entity_checks that usually implement custom lua functions to verify the validity.

For example:

http :8001/schemas/keys

// shortened for brevity
{                                                                                                                                                           
    "entity_checks": [                                                                                                                                      
        {                                                                                                                                                   
            "mutually_exclusive": [                                                                                                                         
                "jwk",                                                                                                                                      
                "pem"                                                         
            ]                                                                                                                                               
        },                                                                                                                                                                                                                                                                
    ],                                                                        
    "fields": [                                                                                                                                             
        {                                                                                                                                                   
            "id": {                                                                                                                                         
                "auto": true,                                                                                                                               
                "description": "A string representing a UUID (universally unique identifier).",                                                             
                "type": "string",                                                                                                                           
                "uuid": true                                                                                                                                
            },                                                                                                                                               
        },
     ],                 
}

Checklist

  • The Pull Request has tests
  • There's an entry in the CHANGELOG

Full changelog

  • Add entity_checks to /schemas endpoint output

Issue reference

https://konghq.atlassian.net/browse/KAG-1593

@jschmid1 jschmid1 force-pushed the feat/entity-checks-in-schemas branch from 31e8220 to e665848 Compare July 6, 2023 14:46
@jschmid1 jschmid1 requested a review from hbagdi July 10, 2023 09:29
Copy link

@fabianrbz fabianrbz left a comment

Choose a reason for hiding this comment

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

LGTM

@kikito kikito dismissed hbagdi’s stale review July 11, 2023 08:06

Change requests addressed

@jschmid1 jschmid1 merged commit 1619701 into master Jul 11, 2023
@jschmid1 jschmid1 deleted the feat/entity-checks-in-schemas branch July 11, 2023 08:06
chronolaw added a commit that referenced this pull request Aug 23, 2023
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