Skip to content

Remove private json package in favor of encoding/json#93

Merged
donatwork merged 3 commits into
chore-code-coveragefrom
chore-code-coverage-dk
Feb 19, 2025
Merged

Remove private json package in favor of encoding/json#93
donatwork merged 3 commits into
chore-code-coveragefrom
chore-code-coverage-dk

Conversation

@donatwork

Copy link
Copy Markdown
Contributor

PR Submission checklist

Remove the older internal version of the json package and instead use the now mature and maintained encoding/json package. This was a drop in replacement as the internal code was from an earlier version of encoding/json. There was one customization of importance which relied on a custom unmarshall directive to prevent marshalling the ID field but still allow unmarshalling of the field. I did not see a modern way of doing that, other than a custom unmarshaller. Given that it is standard practice to separate the request and response structures I opted to use a separate structure, ExportReq for (PUT, POST) requests and the normal Export for responses. Unit tests pass and I ran cert-csi provisioning and volume IO tests.

GitHub Issues

GitHub Issue #
https://github.com/dell/csm/issues/1559

Common PR Checklist:

  • Have you made sure that the code compiles?
  • Have you commented your code, particularly in hard-to-understand areas
  • Did you run tests in a real Kubernetes cluster?
  • Have you maintained backward compatibility

Description of your changes:

  • Removal of api/json
  • Separate request and response structures
  • Add conversion function to limit northbound changes
  • Update of unit tests, remove obsolete tests.

@donatwork donatwork merged commit 370117a into chore-code-coverage Feb 19, 2025
@donatwork donatwork deleted the chore-code-coverage-dk branch February 19, 2025 20:14
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.

3 participants