swagger-api / swagger-api/swagger-codegen
Order of allOf's elements affect to success of Generate Server (Sinatra)
Open
Nobody has claimed this yet.
Feature: Composition / Inheritance
Issue: Bug
Server: Ruby
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
From @orangeudav on April 26, 2016 21:45
Hi! I have swagger-editor@2.9.9
This work fine:
Client:
type: object
allOf:
- $ref: "#/definitions/ClientFactory"
- properties:
id:
description: Id of client
type: integer
format: int32
but if i change order like this
Client:
type: object
allOf:
- properties:
id:
description: Id of client
type: integer
format: int32
- $ref: "#/definitions/ClientFactory"
i get
Code Generator Error
Unable to build target: Could not process model 'Client'
Details:
Object
code: 1
type: "error"
message: "Unable to build target: Could not process model 'Client'"
Is it normal behavior ?
Copied from original issue: swagger-api/swagger-editor#894
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the two Client definitions in the issue using swagger-editor 2.9.9 and the Sinatra server generator. Trace how the generator processes allOf elements and compare both orders; done means establishing whether order should be supported and verifying consistent generation or documenting the intended limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100