Skip to content

[Java] Codegen Bad object serialization when query parameter is Object #907

@SebastienRvl

Description

@SebastienRvl
Description

When y try to send an object in a query with method get, the object is not serialized, the api call toString method

14:57:56.747 [main] DEBUG f.r.p.t.f.l.j.s.r.RestLoggerProvider - --> GET http://localhost:8000/v1/declarations/etablissements?page=class%20PageIn%20%7B%0A%20%20%20%20page%3A%200%0A%20%20%20%20size%3A%200%0A%7D&filtre=class%20FiltreRechercherEtablissementDSN%20%7B%0A%20%20%20%20siret%3A%20null%0A%20%20%20%20siren%3A%20502195977%0A%20%20%20%20annee%3A%20null%0A%20%20%20%20mois%3A%20null%0A%20%20%20%20localite%3A%20null%0A%20%20%20%20effectifCalculeDebutDePeriode%3A%20null%0A%20%20%20%20effectifCalculeFinDePeriode%3A%20null%0A%20%20%20%20denomination%3A%20null%0A%20%20%20%20codeNAF%3A%20null%0A%7D&tri=class%20TriRechercherEtablissementsDSN%20%7B%0A%20%20%20%20siret%3A%20null%0A%20%20%20%20siren%3A%20null%0A%20%20%20%20mois%3A%20null%0A%20%20%20%20localite%3A%20null%0A%20%20%20%20effectifCalculeFinDePeriode%3A%20null%0A%20%20%20%20effectifCalculeDebutDePeriode%3A%20null%0A%20%20%20%20denomination%3A%20null%0A%20%20%20%20codeNAF%3A%20null%0A%20%20%20%20annee%3A%20asc%0A%7D HTTP/1.1

openapi-generator version

3.2.1, 3.2.2 ...

OpenAPI declaration file content or url
'/declarations/etablissements':
    get:
      summary: 'Ce service permet de rechercher les établissements rattachés à une entreprise dans la base stockant les Déclarations Sociales Nominatives à partir d’un Siren et d’une période de déclaration mensuelle.'
      description: |
...
      tags:
        - declarations
        - v1.4.0
      operationId: rechercherDeclarationsEtablissementsDSN
      parameters:
        - name: page
          in: query
          required: false
          style: form
          schema:
            $ref: '#/components/schemas/PageIn'
        - name: filtre
          in: query
          required: false
          style: form
          schema:
            $ref: '#/components/schemas/FiltreRechercherEtablissementDSN'
          example:
            siret: "94555054900162"
        - name: tri
          in: query
          required: false
          style: form
          explode: false
          schema:
            $ref: '#/components/schemas/TriRechercherEtablissementsDSN'
          example:
            denomination: asc
      responses:
        '200':
          description: "Liste d'établissements"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReponseRechercherEtablissement'
        500:
          $ref: '#/components/responses/Erreur_Response'
Command line used for generation
					<execution>
						<id>generate-client-1.2.0</id>
						<goals>
							<goal>generate</goal>
						</goals>
						<phase>generate-sources</phase>
						<configuration>
							<inputSpec>${project.basedir}/src/main/resources/dsnci_ws_consultation_be_v1.2.0.yaml</inputSpec>
							<language>java</language>
							<apiPackage>fr.recouv.dsn.ws.rest.api.v1_0</apiPackage>
							<modelPackage>fr.recouv.dsn.ws.rest.dto.v1_0</modelPackage>
							<output>${generated-swagger-path}</output>
							<withXml>true</withXml>
							<generateApis>true</generateApis>
							<generateApiTests>true</generateApiTests>
						</configuration>
					</execution>
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions