Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #3499
Closed
Open
Issue created Jul 30, 2019 by Administrator@rootContributor

RestTemplate client misses placeholdered URI's in metrics and logs a pre-build one (with replaced variables)

Created by: unintended

Description

Common practice of using resttemplate is to use methods that handle templated paths with variables either use restTemplate.getUriTemplateHandler().expand() to expand path variables, so resttemplate can store and reuse original template path while logging metrics (e.g. via org.springframework.boot.actuate.metrics.web.client.MetricsClientHttpRequestInterceptor in Spring Boot 2), etc.

openapi-generator version

master

OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

I suggest to replace static call in Api client method from:

UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString()

with one that addresses uriTemplateHandler of restTemplate, eg :

restTemplate.getUriTemplateHandler().expand("/pet/{petId}", uriVariables).toString();
Assignee
Assign to
Time tracking