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

[CMSP-217] Accept siteID key as either int or string #22

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pwtyler
Copy link
Member

@pwtyler pwtyler commented Apr 11, 2023

As part of implementing pantheon-systems/terminus-yml-validator-plugin#1, I discovered it is difficult, if not impossible, for PHP to differentiate between siteID keys being an int, or a string that could be cast to an int.

Rather than jumping through a lot of hoops on the PHP side, I opted to make the go validator a bit more flexible.

TODO:

  • assert how the search-replace script behaves if the key is an int in one case and a string in the other, and adapt accordingly (this can be done as part of upgrading sites-yml-validator in the job worker and does not need to block PR).

pkg/validator/sites_test.go Outdated Show resolved Hide resolved
@pwtyler pwtyler changed the title Test invalid string as key [CMSP-217] Accept siteID key as either int or string Apr 12, 2023
@pwtyler
Copy link
Member Author

pwtyler commented Apr 12, 2023

  • TODO: Update Readme.

pkg/model/sites.go Outdated Show resolved Hide resolved
pkg/validator/sites.go Outdated Show resolved Hide resolved
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.

1 participant