Partage
  • Partager sur Facebook
  • Partager sur Twitter

Yaml génère un request body pour rien

Reqest Get en java génère un request body dans mon yaml pour rien

    22 mars 2022 à 14:38:51

    Bonjour,

    j'ai cette method Get :

    @Path("/mobile")
    @RestController
    @Scope(scopeName = "request")
    public interface IMouvementStockController {
        @GET
        @Path("/getlisteclients")
        @Operation(summary = "Récupération de la liste des clients", description = "Envoi de la liste de clients à MyIris")
        @ApiResponses(value = {@ApiResponse(
                content = @Content(mediaType = "application/json",
                        schema = @Schema(implementation = ResponseMouvementStockDTO.class)),
                responseCode = "200", description = "Liste de clients envoyée."
        ),
                @ApiResponse(
                        content = @Content(mediaType = "application/json",
                                schema = @Schema(implementation = ErreurMouvementStockDTO.class)),
                        description = "Une erreur technique est survenue.")})
    
        @Produces("application/json")
        @GetMapping("/mobile/getlisteclients")
        public ResponseEntity<ResponseMouvementStockDTO> getListeDeClients(@RequestHeader HttpHeaders headers);
    }

    qui me génère cette partie dans mon yaml :

    /mobile/getlisteclients:
    get:
      summary: Récupération de la liste des clients
      description: Envoi de la liste de clients à MyIris
      operationId: getListeDeClients
      requestBody:
        content:
          '*/*':
            schema:
              type: object
              properties:
                all:
                  type: object
                  additionalProperties:
                    type: string
                  writeOnly: true
                empty:
                  type: boolean
                location:
                  type: string
                  format: uri
                host:
                  type: object
                  properties:
                    address:
                      type: object
                      properties:
                        canonicalHostName:
                          type: string
                        hostAddress:
                          type: string
                        address:
                          type: array
                          items:
                            type: string
                            format: byte
                        hostName:
                          type: string
                        multicastAddress:
                          type: boolean
                        anyLocalAddress:
                          type: boolean
                        loopbackAddress:
                          type: boolean
                        linkLocalAddress:
                          type: boolean
                        siteLocalAddress:
                          type: boolean
                        mcglobal:
                          type: boolean
                        mcnodeLocal:
                          type: boolean
                        mclinkLocal:
                          type: boolean
                        mcsiteLocal:
                          type: boolean
                        mcorgLocal:
                          type: boolean
                    port:
                      type: integer
                      format: int32
                    unresolved:
                      type: boolean
                    hostName:
                      type: string
                    hostString:
                      type: string
                lastModified:
                  type: integer
                  format: int64
                contentType:
                  $ref: '#/components/schemas/MediaType'
                contentLength:
                  type: integer
                  format: int64
                date:
                  type: integer
                  format: int64
                ifModifiedSince:
                  type: integer
                  format: int64
                connection:
                  type: array
                  items:
                    type: string
                origin:
                  type: string
                range:
                  type: array
                  items:
                    $ref: '#/components/schemas/HttpRange'
                acceptLanguageAsLocales:
                  type: array
                  items:
                    type: object
                    properties:
                      language:
                        type: string
                      script:
                        type: string
                      country:
                        type: string
                      variant:
                        type: string
                      extensionKeys:
                        uniqueItems: true
                        type: array
                        items:
                          type: string
                      unicodeLocaleAttributes:
                        uniqueItems: true
                        type: array
                        items:
                          type: string
                      unicodeLocaleKeys:
                        uniqueItems: true
                        type: array
                        items:
                          type: string
                      iso3Language:
                        type: string
                      iso3Country:
                        type: string
                      displayLanguage:
                        type: string
                      displayScript:
                        type: string
                      displayCountry:
                        type: string
                      displayVariant:
                        type: string
                      displayName:
                        type: string
                accessControlAllowMethods:
                  type: array
                  items:
                    type: string
                    enum:
                    - GET
                    - HEAD
                    - POST
                    - PUT
                    - PATCH
                    - DELETE
                    - OPTIONS
                    - TRACE
                accessControlExposeHeaders:
                  type: array
                  items:
                    type: string
                accessControlMaxAge:
                  type: integer
                  format: int64
                accessControlRequestMethod:
                  type: string
                  enum:
                  - GET
                  - HEAD
                  - POST
                  - PUT
                  - PATCH
                  - DELETE
                  - OPTIONS
                  - TRACE
                accessControlAllowHeaders:
                  type: array
                  items:
                    type: string
                accessControlRequestHeaders:
                  type: array
                  items:
                    type: string
                contentDisposition:
                  $ref: '#/components/schemas/ContentDisposition'
                accessControlAllowCredentials:
                  type: boolean
                accessControlAllowOrigin:
                  type: string
                ifUnmodifiedSince:
                  type: integer
                  format: int64
                etag:
                  type: string
                ifMatch:
                  type: array
                  items:
                    type: string
                ifNoneMatch:
                  type: array
                  items:
                    type: string
                acceptPatch:
                  type: array
                  items:
                    $ref: '#/components/schemas/MediaType'
                accept:
                  type: array
                  items:
                    $ref: '#/components/schemas/MediaType'
                expires:
                  type: integer
                  format: int64
                allow:
                  uniqueItems: true
                  type: array
                  items:
                    type: string
                    enum:
                    - GET
                    - HEAD
                    - POST
                    - PUT
                    - PATCH
                    - DELETE
                    - OPTIONS
                    - TRACE
                cacheControl:
                  type: string
                upgrade:
                  type: string
                acceptLanguage:
                  type: array
                  items:
                    type: object
                    properties:
                      range:
                        type: string
                      weight:
                        type: number
                        format: double
                basicAuth:
                  type: string
                  writeOnly: true
                vary:
                  type: array
                  items:
                    type: string
                bearerAuth:
                  type: string
                  writeOnly: true
                contentLanguage:
                  type: object
                  properties:
                    language:
                      type: string
                    script:
                      type: string
                    country:
                      type: string
                    variant:
                      type: string
                    extensionKeys:
                      uniqueItems: true
                      type: array
                      items:
                        type: string
                    unicodeLocaleAttributes:
                      uniqueItems: true
                      type: array
                      items:
                        type: string
                    unicodeLocaleKeys:
                      uniqueItems: true
                      type: array
                      items:
                        type: string
                    iso3Language:
                      type: string
                    iso3Country:
                      type: string
                    displayLanguage:
                      type: string
                    displayScript:
                      type: string
                    displayCountry:
                      type: string
                    displayVariant:
                      type: string
                    displayName:
                      type: string
                pragma:
                  type: string
                acceptCharset:
                  type: array
                  items:
                    type: object
                    properties:
                      registered:
                        type: boolean
              additionalProperties:
                type: array
                items:
                  type: string
      responses:
        "200":
          description: Liste de clients envoyée.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseMouvementStockDTO'
        default:
          description: Une erreur technique est survenue.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErreurMouvementStockDTO'
    

    et quand je met ce yaml dans Swagger j'ai cette erreur :


    Semantic error at paths./mobile/getlisteclients.get.requestBody GET operations cannot have a requestBody.

    Je ne sais pas trop pourquoi un requestBody est généré ici, si quelqu'un a une idée je suis preneur. Merci

    • Partager sur Facebook
    • Partager sur Twitter

    Yaml génère un request body pour rien

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown