OpenAPITools / OpenAPITools/openapi-generator

[BUG] two levels of allOf forget parameter

Open
#10,638 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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

When there are two levels of allOf it seems that the properties in the middle are lost

openapi-generator version

5.2.1

OpenAPI declaration file content or url

https://github.com/Azure/azure-rest-api-specs/blob/3f4d11b1996c6da78de1e7d2765b7be390a8a38a/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2017-04-01/namespaces.json

Generation Details
openapi-generator-cli generate \
-i specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2017-04-01/namespaces.json \
--api-package org.speefl.azure.api \
--model-package org.speefl.azure.api.model \
--invoker-package org.speefl.azure.api.invoker \
--group-id org.speedfl.azure-api-client \
--artifact-id namespaces \
--artifact-version 0.0-SNAPSHOT \
-g java \
-p java8=true \
-p apiTests=false \
-p modelTests=false \
--library microprofile \
-o /path/to/
Steps to reproduce

Clone repo: https://github.com/Azure/azure-rest-api-specs

openapi-generator-cli generate \
-i specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2017-04-01/namespaces.json \
--api-package org.speefl.azure.api \
--model-package org.speefl.azure.api.model \
--invoker-package org.speefl.azure.api.invoker \
--group-id org.speedfl.azure-api-client \
--artifact-id namespaces \
--artifact-version 0.0-SNAPSHOT \
-g java \
-p java8=true \
-p apiTests=false \
-p modelTests=false \
--library microprofile \
-o /path/to/

Look at the generated file: SBNamespace.java

It misses the location and tags properties located in specification/servicebus/resource-manager/common/v1/definitions.json

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the supplied openapi-generator-cli command against the Azure servicebus namespaces.json input and inspect the generated SBNamespace.java. Compare it with the allOf definitions in common/v1/definitions.json, especially the location and tags properties. Done means those inherited properties are present in the generated Java model.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.