swagger-api / swagger-api/swagger-codegen

[SWIFT3] Bug in code gen while generating typealias

Open
#7,823 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description
Swagger-codegen version

2.3.0

Swagger declaration file content or url
ValidatePaymentMethodsDictionary:
    type: object
    allOf:
      - $ref: '#/definitions/DictionaryCommon'


DictionaryCommon:
    type: object
    discriminator: dictionaryCommonType
    allOf:
      - $ref: '#/definitions/FlightDictionary'
      - type: object
        discriminator: dictionaryCommonType
        properties:
          tax:
            type: object
            description: >-
              Taxes map. For more details please see [Maps in dictionary
              documentation](http://e-travel.mkt.amadeus.net/digitalapi/swagger-ui/specs/release_1.6/documentation.html#!/Maps/get)
            additionalProperties:
              type: string
          surcharge:
            type: object
            description: >-
              Surcharges map. For more details please see [Maps in dictionary
              documentation](http://e-travel.mkt.amadeus.net/digitalapi/swagger-ui/specs/release_1.6/documentation.html#!/Maps/get)
            additionalProperties:
              type: string
          currency:
            type: object
            description: >-
              Currencies map. For more details please see [Maps in dictionary
              documentation](http://e-travel.mkt.amadeus.net/digitalapi/swagger-ui/specs/release_1.6/documentation.html#!/Maps/get)
            additionalProperties:
              $ref: '#/definitions/CurrencyDictionaryItem'
          anonymousTraveler:
            type: object
            description: >-
              Basic information about an anonymous traveler such as the
              passenger type code and the frequent flyer card(s). Frequent flyer
              cards applies only for a particular case: a transaction based on a
              cart already containing frequent flyer card(s) but not yet
              traveler(s). For more details please see [Maps in dictionary
              documentation](http://e-travel.mkt.amadeus.net/digitalapi/swagger-ui/specs/release_1.6/documentation.html#!/Maps/get)
            additionalProperties:
              $ref: '#/definitions/AnonymousTraveler'
          traveler:
            type: object
            description: >-
              Information about a traveler such as first and last name. For more
              details please see [Maps in dictionary
              documentation](http://e-travel.mkt.amadeus.net/digitalapi/swagger-ui/specs/release_1.6/documentation.html#!/Maps/get)
            additionalProperties:
              $ref: '#/definitions/Traveler'
          seatCharacteristic:
            type: object
            description: >-
              Seat characteristics map. For more details please see [Maps in
              dictionary
              documentation](http://e-travel.mkt.amadeus.net/digitalapi/swagger-ui/specs/release_1.6/documentation.html#!/Maps/get)
            additionalProperties:
              $ref: '#/definitions/SeatCharacteristicDictionaryItem'
          dictionaryCommonType:
            type: string
            description: DictionaryCommon subtypes
            enum:
              - AirOfferDictionary
              - CartDictionary
              - AirCalendarDictionary

Command line used for generation

MAC terminal

Error in xcode
screen shot 2018-03-12 at 9 02 29 pm

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 Swift 3 generation with the supplied YAML declaration and inspect the generated typealias alongside the Xcode error shown in the issue. Trace the typealias handling in the generator and confirm that the same declaration produces valid Swift 3 output without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.