Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7951
Closed
Open
Issue created Nov 16, 2020 by Administrator@rootContributor0 of 1 checklist item completed0/1 checklist item

[BUG][JAVA][SPRING] Invalid allOf generation for RestAssured library

Created by: fablerq

Bug Report Checklist

  • [ x ] Have you provided a full/minimal spec to reproduce the issue?
  • [ x ] Have you validated the input using an OpenAPI validator (example)?
  • [ x ] Have you tested with the latest master to confirm the issue still exists?
  • [ x ] Have you searched for related issues/PRs?
  • [ x ] What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Yaml files containing the allOf keywords don't work well with the rest-assured library. I'm getting a list of objects instead of a list of something reasonable, so I don't have direct access to its field.

openapi-generator version

I tested with the latest beta release (v5.0.0-beta2) and latest stable release

OpenAPI declaration file content or url
openapi: 3.0.2
info:
  title: ''
  description: ''
  version: 0.1.0
servers:
  - url: /v1/bar
paths:
  /foo:
    get:
      description: ''
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  foo:
                    description: ''
                    type: array
                    items:
                      allOf:
                        - type: object
                          properties:
                            first_id:
                              type: number
                              format: int64
                        - type: object
                          properties:
                            second_id:
                              type: number
                              format: int64
Generation Details

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i example.yaml -o /var/tmp/restassured --library rest-assured

Steps to reproduce, actual/expected output
  • Generate classes
  • Look inside InlineResponse200 class. Foo field is a list of Objects, not list of special generated POJOs
Related issues/PRs
Suggest a fix

It could be fixed by merging properties of each object into single object, but it requires time and this is manual operation

Assignee
Assign to
Time tracking