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

keep order from api response #44

Merged
merged 1 commit into from
Jun 21, 2024
Merged

keep order from api response #44

merged 1 commit into from
Jun 21, 2024

Conversation

strokyl
Copy link
Collaborator

@strokyl strokyl commented Jun 20, 2024

The issue with go is that when it deserializes from JSON it uses Map which loses order.
To avoid that I build a custom structure using orderedMap that keeps insertion order.
This structure supports JSON marshalling/unmarshalling and yaml marshalling.

But what's funny is that before, we already had a hack to have a fixed order for top-level field:

  • apiVersion
  • kind
  • metadata
  • spec

And unfortunately current release of console-plus does not respect this order.
So I had to keep old hack and adapt it to the new structure until we fix that on the backend

@strokyl strokyl force-pushed the keep_order_from_api_response branch 2 times, most recently from 93b1d83 to 30b419e Compare June 20, 2024 15:54
@strokyl strokyl force-pushed the keep_order_from_api_response branch from 30b419e to c4f8429 Compare June 20, 2024 16:09
@strokyl strokyl merged commit 4695534 into main Jun 21, 2024
4 checks passed
@strokyl strokyl deleted the keep_order_from_api_response branch June 21, 2024 08:44
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