[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