swagger-api / swagger-api/swagger-codegen

Order of allOf's elements affect to success of Generate Server (Sinatra)

Open
#2,729 1 comment 0 reactions 0 assignees View on GitHub

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.