如何使用Apache Camel设置OpenAPI的服务器属性?

发布于 2025-02-08 06:11:02 字数 1109 浏览 2 评论 0原文

我正在尝试设置OpenAPI规范,并使用Apache Camel和Spring发布API。我尝试使用RestConfiguration,在应用程序中添加属性,然后在应用程序上使用@openapiproperty。每次生成的YAML都会读取:

- servers
  - url: ""
platform:
  # not used
  urlrewrite:
    enabled: false
    token: ${LOCAL_TOKEN:}
    apim:
      token_ep: ${x/token}
      client:
        username: ${apim_client_username:}
        password: ${apim_client_password:}
        consumerKey: ${apim_client_id:}
        consumerSecret: ${apim_client_secret:}

  endpointsOrchestrated:
    server: myServer
    emr-endpoint: xxxxxxxx
  triggerName: ${PLATFORM_MODULE_ID}
  env: dev
  domain: ${PLATFORM_MODULE_DOMAIN}

openapi:
  title: My Sample api
  version: 1.0.0

camel:
  dataformat:
    jackson:
      auto-discover-object-mapper: true
  springboot:
    tracing: false
  rest:
    host: myhost.com
    port: 8080

spring:
  application:
    name: aaa
  profiles:
    active: ${ENV:local}

server:
  servlet:
    context-path: /
  port: ${TOMCAT_PORT:8080}
  host: localhost
  # MAX HTTP THREADS
  tomcat:
    threads:
      max: ${MAIN_HTTP_THREADS:200}


I am trying to setup a openapi specification and publish the API with Apache Camel and Spring. I tried using restConfiguration, adding the property in the application.yaml, and using the @OpenApiProperty on the app. Everytime the generated yaml reads:

- servers
  - url: ""
platform:
  # not used
  urlrewrite:
    enabled: false
    token: ${LOCAL_TOKEN:}
    apim:
      token_ep: ${x/token}
      client:
        username: ${apim_client_username:}
        password: ${apim_client_password:}
        consumerKey: ${apim_client_id:}
        consumerSecret: ${apim_client_secret:}

  endpointsOrchestrated:
    server: myServer
    emr-endpoint: xxxxxxxx
  triggerName: ${PLATFORM_MODULE_ID}
  env: dev
  domain: ${PLATFORM_MODULE_DOMAIN}

openapi:
  title: My Sample api
  version: 1.0.0

camel:
  dataformat:
    jackson:
      auto-discover-object-mapper: true
  springboot:
    tracing: false
  rest:
    host: myhost.com
    port: 8080

spring:
  application:
    name: aaa
  profiles:
    active: ${ENV:local}

server:
  servlet:
    context-path: /
  port: ${TOMCAT_PORT:8080}
  host: localhost
  # MAX HTTP THREADS
  tomcat:
    threads:
      max: ${MAIN_HTTP_THREADS:200}


如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文