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

feat: make generated test values comply with url path template #903

Merged
merged 2 commits into from
Jan 21, 2022

Commits on Jan 21, 2022

  1. feat: make generated test values comply with url path template

    This includes nested messages creation when there are url paths with subfields mentioned (like `/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}`)
    
    This is needed for rest transports tests, because unlike grpc, request fields must match path templates for rest logic pass the tests.
    
    Main changes are in `DefaultValueComposer` and `HttpRuleParser` classes.
    
    The generated pattern-matching samples are in the following format:
    given the pattern pattern:
    ```
    /v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}
    ```
    the value will be:
    ```
    field.name=projects/project-1234/databases/database-1234/collectionGroups/collectionGroup-1234/fields/field-1234
    ```
    vam-google committed Jan 21, 2022
    Configuration menu
    Copy the full SHA
    d3dca27 View commit details
    Browse the repository at this point in the history
  2. address PR feedback

    vam-google committed Jan 21, 2022
    Configuration menu
    Copy the full SHA
    3f692cb View commit details
    Browse the repository at this point in the history