Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deepObject query string support in Java native client #14378

Merged
merged 7 commits into from
Jan 6, 2023

Conversation

wing328
Copy link
Member

@wing328 wing328 commented Jan 4, 2023

Add deepObject query string support in Java native client

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (6.3.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

cc @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10)

@wing328 wing328 marked this pull request as ready for review January 6, 2023 08:45
@wing328 wing328 merged commit d269a2a into master Jan 6, 2023
@wing328 wing328 deleted the java-native-deepobject branch January 6, 2023 09:10
@s-jepsen
Copy link
Contributor

Appears this change has introduced a bug, when generating a Java native client - from a contract having a oneOf with discriminator set using allOf:

[ERROR] /Users/sorenjepsen/IdeaProjects/demo/target/generated-sources/openapi/src/main/java/client/javanative/api/PhysicalAspect.java:[163,31] cannot find symbol [ERROR] symbol: method toUrlQueryString(java.lang.String) [ERROR] location: class client.javanative.api.PhysicalMounting

Contract example:

openapi: 3.0.3
info:
  contact:
    email: [email protected]
    name: name
    url: https://whatever.com
  description: Internal API
  title: Internal API
  version: 1.0.0
  x-audience: business-unit-internal
  x-api-id: 3addb128-c3fb-4bfe-a5d9-c84b3bd58ca2
servers:
- description: Local environment
  url: http://localhost:9090/api
paths:
  /authenticated/organizations/aspects/physical-aspects:
    get:
      operationId: listAll
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhysicalAspectsResponse'
          description: List of the physicals
      summary: List all physicals
      tags:
      - Physical
      x-accepts: application/json
    put:
      operationId: update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePhysicalRequest'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhysicalAspectResponse'
          description: Physical aspect updated successfully
      summary: Update Physical aspect
      tags:
      - Physical
      x-content-type: application/json
      x-accepts: application/json
components:
  schemas:
    PhysicalAspectsResponse:
      example:
        physicals:
        - identifiable_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
          mounting: null
        - identifiable_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
          mounting: null
      properties:
        physicals:
          items:
            $ref: '#/components/schemas/PhysicalAspect'
          type: array
      required:
      - physicals
      type: object
    UpdatePhysicalRequest:
      example:
        physical:
          identifiable_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
          mounting: null
      properties:
        physical:
          $ref: '#/components/schemas/PhysicalAspect'
      required:
      - physical
      type: object
    PhysicalAspectResponse:
      example:
        physical:
          identifiable_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
          mounting: null
      properties:
        physical:
          $ref: '#/components/schemas/PhysicalAspect'
      required:
      - physical
      type: object
    PhysicalAspect:
      example:
        identifiable_id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
        mounting: null
      properties:
        identifiable_id:
          format: uuid
          type: string
        mounting:
          $ref: '#/components/schemas/PhysicalMounting'
      required:
      - identifiable_id
      - mounting
      type: object
    PhysicalMounting:
      oneOf:
      - $ref: '#/components/schemas/NotMountedMounting'
      - $ref: '#/components/schemas/FloorMounting'
      - $ref: '#/components/schemas/LocationMounting'
      type: object
    NotMountedMounting:
      allOf:
      - $ref: '#/components/schemas/Discriminator'
      properties:
        mountable_type:
          $ref: '#/components/schemas/MountableType'
      type: object
    FloorMounting:
      allOf:
      - $ref: '#/components/schemas/Discriminator'
      properties:
        mountable_type:
          $ref: '#/components/schemas/MountableType'
        orientation:
          format: float
          maximum: 360
          minimum: -360
          type: number
      required:
      - orientation
      type: object
    LocationMounting:
      allOf:
      - $ref: '#/components/schemas/Discriminator'
      properties:
        mountable_type:
          $ref: '#/components/schemas/MountableType'
      type: object
    Discriminator:
      discriminator:
        propertyName: object_type
      properties:
        object_type:
          type: string
      required:
      - object_type
      type: object
    MountableType:
      enum:
      - FIXED
      - LOCATION
      type: string

@wing328
Copy link
Member Author

wing328 commented Jan 13, 2023

@s-jepsen thanks for reporting the issue. Let me fix it.

@bjorgvino
Copy link
Contributor

bjorgvino commented Jan 20, 2023

@wing328 have you fixed this yet? If not, here's a branch I'm currently working on: master...bjorgvino:openapi-generator:fix-supportUrlQuery-templates-and-additionalProperties

Just struggling with errors that were present on master already... 🤔

@bjorgvino
Copy link
Contributor

Fixed in #14496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants