代码之家  ›  专栏  ›  技术社区  ›  Hantsy

JAX-RS子资源未在Quarkus OpenAPI架构中生成

  •  0
  • Hantsy  · 技术社区  · 6 年前

    the answer of this question .

    但是当我在这个项目中启用OpenAPI支持时。CommentResource(的子资源) PostResource )不是在OpenAPI架构中生成的。

    curl http://localhost:8080/openapi
    curl http://localhost:8080/openapi
    ---
    openapi: 3.0.1
    info:
      title: Generated API
      version: "1.0"
    paths:
      /hello:
        get:
          responses:
            200:
              description: OK
              content:
                text/plain:
                  schema:
                    $ref: '#/components/schemas/String'
      /hello/async:
        get:
          responses:
            200:
              description: OK
              content:
                text/plain:
                  schema:
                    type: string
      /hello/greeting/{name}:
        get:
          parameters:
          - name: name
            in: path
            required: true
            schema:
              $ref: '#/components/schemas/String'
          responses:
            200:
              description: OK
              content:
                text/plain:
                  schema:
                    $ref: '#/components/schemas/String'
      /posts:
        get:
          responses:
            200:
              description: OK
              content:
                application/json: {}
        post:
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Post'
          responses:
            200:
              description: OK
              content:
                '*/*': {}
      /posts/{id}:
        get:
          parameters:
          - name: id
            in: path
            required: true
            schema:
              $ref: '#/components/schemas/String'
          responses:
            200:
              description: OK
              content:
                application/json: {}
        put:
          parameters:
          - name: id
            in: path
            required: true
            schema:
              $ref: '#/components/schemas/String'
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Post'
          responses:
            200:
              description: OK
              content:
                '*/*': {}
        delete:
          parameters:
          - name: id
            in: path
            required: true
            schema:
              $ref: '#/components/schemas/String'
          responses:
            200:
              description: OK
              content:
                '*/*': {}
    components:
      schemas:
        String:
          type: string
        Post:
          type: object
          properties:
            content:
              type: string
            createdAt:
              format: date-time
              type: string
            id:
              type: string
            title:
              type: string
    
    0 回复  |  直到 6 年前
    推荐文章