Skip to content

refactor: expose parsed api short name and version as fields in Service#1075

Merged
emmileaf merged 5 commits intomainfrom
refactor-parse-defaulthost-2
Oct 31, 2022
Merged

refactor: expose parsed api short name and version as fields in Service#1075
emmileaf merged 5 commits intomainfrom
refactor-parse-defaulthost-2

Conversation

@emmileaf
Copy link
Copy Markdown
Contributor

Follow-up to #1066.

This PR exposes parsed apiShortName and apiVersion as fields in Service.java, since the source fields (defaultHost and protoPakkage) are both defined per-service. It also:

  • Adds these two fields correspondingly to GapicClass so that it can be composed from Service given these two upstream fields, then replaces withDefaultHost (for building GapicClass) added in fix: update sample region tag to parse host instead of proto package #1040 with withApiShortName and withApiVersion. (Composers and tests where this is currently used for sample generation are updated)

This change will enable Spring Codegen (when eventually split out from this repo) to reuse this parsing logic in descriptive comments and metadata. It also moves the parsing logic to earlier in the parse-compose process.

Loading
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