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

Sort required fields before others #78

Merged
merged 1 commit into from
Sep 11, 2021
Merged

Sort required fields before others #78

merged 1 commit into from
Sep 11, 2021

Conversation

cbandy
Copy link
Contributor

@cbandy cbandy commented Sep 11, 2021

I noticed that required fields were always rendered last. It appears they are intended to be first. This inverts the sort criteria and adds a test.

// orderedPropertyKeys returns the keys of m alphabetically ordered
// keys in required will be placed first
func orderedPropertyKeys(required []string, m map[string]apiextensions.JSONSchemaProps, isResource bool) []string {

Signed-off-by: Chris Bandy <bandy.chris@gmail.com>
@cbandy cbandy requested a review from roee88 as a code owner September 11, 2021 05:28
Copy link
Contributor

@roee88 roee88 left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the fix!

@roee88 roee88 merged commit fa9ffd4 into fybrik:main Sep 11, 2021
@cbandy cbandy deleted the sorting branch September 11, 2021 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants