feat: Add the apiVersion protected property to the generated resources when applicable
Add the protected apiVersion property to the generated resource classes when the discovery document contains the apiVersion field inside the resource fields.
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!
-- conventional-commit-lint bot https://conventionalcommits.org/
Same thing with this PR, we need to either manually update the goldens to include an API with
apiversion(recommended), or we need to add a different specific test for it.
Correct me if I'm wrong, but we are using the discovery-artifact-manager repo as our golden, that's how I tested the generated code. Do we want to make a PR against that repo?
Correct me if I'm wrong, but we are using the
discovery-artifact-managerrepo as our golden
No, we use the JSON here: https://github.com/googleapis/google-api-php-client-services/tree/main/generator/tests/testdata/golden_discovery
Correct me if I'm wrong, but we are using the
discovery-artifact-managerrepo as our goldenNo, we use the JSON here: https://github.com/googleapis/google-api-php-client-services/tree/main/generator/tests/testdata/golden_discovery
I added a file to tests/testdata/versioned_sample_discovery.json here:
https://github.com/googleapis/google-api-php-client-services/pull/4966/files#diff-8b1ea50f148cf373178d6ee36e0bc1f6f5645e0e74048166d18ab27023d1e054
And I am using it in the test here: https://github.com/googleapis/google-api-php-client-services/pull/4966/files#diff-10ee932e5fe7b3b57f6fed477c8f9e616dfb1f0cfb9dbed246dbfa8dc3ca8cb7R561
+@parthea for visibility. Would love you to take a glance at this to make sure it looks good!