Skip to content

http://editor.swagger.io/ Can't genearte sever and client code #1170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mohsen1 opened this issue Sep 1, 2015 · 21 comments
Closed

http://editor.swagger.io/ Can't genearte sever and client code #1170

mohsen1 opened this issue Sep 1, 2015 · 21 comments
Milestone

Comments

@mohsen1
Copy link

mohsen1 commented Sep 1, 2015

From @huaw on September 1, 2015 17:8

Try to generate Node.js Sever and C# client code, I am getting following error:
capture error

Code Generator Error

something bad happened

Details:

► Object

code: 500

type: "unknown"

message: "something bad happened"

Copied from original issue: swagger-api/swagger-editor#616

@mohsen1
Copy link
Author

mohsen1 commented Sep 1, 2015

Can you share your Swagger document?

@mohsen1
Copy link
Author

mohsen1 commented Sep 1, 2015

From @huaw on September 1, 2015 18:40

It happens to example uber file as well.

However please see the attached file

From: Mohsen Azimi [mailto:[email protected]]
Sent: Tuesday, September 01, 2015 1:09 PM
To: swagger-api/swagger-editor [email protected]
Cc: Hua Wu [email protected]
Subject: Re: [swagger-editor] http://editor.swagger.io/ Can't genearte sever and client code (#616)

Can you share your Swagger document?


Reply to this email directly or view it on GitHubhttps://github.com/swagger-api/swagger-editor/issues/616#issuecomment-136799035.

@mohsen1
Copy link
Author

mohsen1 commented Sep 1, 2015

Which server and client generators did you try? I don't see any error with Uber example when I try it.

You can't attach files to GitHub issues. Please paste your Swagger here.

@mohsen1
Copy link
Author

mohsen1 commented Sep 1, 2015

From @huaw on September 1, 2015 19:19

See the swagger text

# Example YAML to get you started quickly.
# Be aware that YAML has indentation based scoping.
# Code completion support is available so start typing for available options.
swagger: '2.0'

# This is your document metadata
info:
  version: "1.0.10"
  title: Road Scholar
  description: API for Road Scholar website
schemes:
  - http
  - https
consumes:
  - application/json
  - text/xml
produces:
  - application/json
  - text/html
paths:
  /users:
    post:
      summary: Creates user
      description: |
        Creates a new user in Siebel along with an empty account or may return existing account. Email must be verified.
      parameters:
        - name: user
          in: body
          description: User object that needs to be created
          schema:
            $ref: '#/definitions/NewUser'
          required: true
      responses:
        200:
          description: successful operation
          schema:
            $ref: '#/definitions/Pointer'
        405:
          description: Invalid input
      tags:
        - Users

  /users/{id}:
    put:
      summary: Update user
      description: |
        Updates `user` object.
      parameters:
        - name: id
          in: path
          description: ID of user to update
          required: true
          type: string
        -
          name: user
          in: body
          description: User object that needs to be updated
          required: true
          schema:
            $ref: '#/definitions/UpdateUser'
      responses:
        200:
          description: successful operation
        405:
          description: Validation exception
        404:
          description: User not found
        403:
          description: Permission denied
        400:
          description: Invalid ID supplied
      tags:
        - Users


    get:
      summary: Get user
      description: Returns a user based on a single ID
      operationId: findUserById
      parameters:
        - name: id
          in: path
          description: ID of user to fetch
          required: true
          type: string
      responses:
        200:
          description: user response
          schema:
            $ref: '#/definitions/User'
        404:
          description: User not found
        403:
          description: Permission denied
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Users

  /users/{id}/account:
    get:
      description: Returns a user account
      parameters:
        - name: id
          in: path
          description: ID of user to fetch account for
          required: true
          type: string
        - name: fields
          in: query
          description: Comma delimited list of fields
          required: false
          type: string
        - name: embed
          in: query
          description: Comma delimited list of embedded objects
          required: false
          type: string
      responses:
        '200':
          description: account response depends on fields/embed
          schema:
            $ref: '#/definitions/Account'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Accounts
    put:
      description: |
        Updates `account` object.
      parameters:
        - name: id
          in: path
          description: ID of user to update account for
          required: true
          type: string
        - name: account
          in: body
          description: The account JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/AccountUpdate'
      responses:
        200:
          description: Updates a account
      tags:
        - Accounts

  /users/{id}/account/users:
    post:
      description: |
        Creates a new user for the account.
      parameters:
        - name: id
          in: path
          description: ID of user to update account for
          required: true
          type: string
        - name: user
          in: body
          description: User object that needs to be updated
          required: true
          schema:
            $ref: '#/definitions/UpdateUser'
      responses:
        200:
          description: successful operation
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Accounts

  /users/{id}/account/addresses:
    post:
      description: |
        Creates `address` object.
      parameters:
        - name: id
          in: path
          description: ID of user to create an address
          required: true
          type: string
        - name: address
          in: body
          description: The address JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/UpdateAddress'
      responses:
        200:
          description: Creates an address
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Address
  /users/{id}/account/addresses/{addrid}:
    put:
      description: |
        Updates `Address` object.
      parameters:
        - name: id
          in: path
          description: ID of user to update Address for
          required: true
          type: string
        - name: addrid
          in: path
          description: ID of Address to update
          required: true
          type: string
        - name: address
          in: body
          description: The address JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/UpdateAddress'
      responses:
        200:
          description: Updates an address
      tags:
        - Address


  /users/{id}/quotes:
    post:
      description: |
        Creates `quote` object.
      parameters:
        - name: id
          in: path
          description: ID of user to create a quote
          required: true
          type: string
        - name: quote
          in: body
          description: The quote JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/NewQuote'
      responses:
        200:
          description: Creates a quote
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Quotes

  /users/{id}/quotes/{qid}:
    put:
      description: |
        Updates `quote` object.
      parameters:
        - name: id
          in: path
          description: ID of user to update quote for
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote you want to update
          required: true
          type: string
        - name: quote
          in: body
          description: The quote JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/UpdateQuote'
      responses:
        200:
          description: Updates a quote
      tags:
        - Quotes

    get:
      description: Returns a quote for a user
      parameters:
        - name: id
          in: path
          description: ID of user to fetch
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote to fetch
          required: true
          type: string
        - name: fields
          in: query
          description: Comma delimited list of fields
          required: false
          type: string
        - name: embed
          in: query
          description: Comma delimited list of embedded objects
          required: false
          type: string
      responses:
        '200':
          description: quote response
          schema:
            $ref: '#/definitions/Quote'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Quotes

  /users/{id}/quotes/{qid}/travelers:
    post:
      description: |
        Creates `traveler` object for a quote.
      parameters:
        - name: id
          in: path
          description: ID of user to create traveler
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote to create traveler
          required: true
          type: string
        - name: travelers
          in: body
          description: The array of travelers JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/TravelersArray'
      responses:
        200:
          description: Creates a traveler, returns location to quote
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Quotes

  /users/{id}/quotes/{qid}/travelers/{travuid}:
    put:
      description: |
        Updates `traveler` object for a quote.
      parameters:
        - name: id
          in: path
          description: ID of user to update traveler
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote to update traveler
          required: true
          type: string
        - name: travuid
          in: path
          description: ID of traveler to update
          required: true
          type: string
        - name: traveler
          in: body
          description: The traveler JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/UpdateTraveler'
      responses:
        200:
          description: Updates a traveler
      tags:
        - Quotes

    delete:
      description: |
        Removes `traveler` object from quote.
      parameters:
        - name: id
          in: path
          description: ID of user to removes traveler
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote to remove traveler
          required: true
          type: string
        - name: travuid
          in: path
          description: ID of traveler to remove
         required: true
          type: string
      responses:
        200:
          description: traveler removed
      tags:
        - Quotes



  /anon/quotes:
    post:
      description: |
        Creates `quote` object for anonymous user
      parameters:
        - name: quote
          in: body
          description: The quote JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/NewAnonQuote'
      responses:
        200:
          description: Creates a quote, returns location of /anon/quote
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Quotes

  /anon/quotes/{qid}:
    put:
      description: |
        Updates anonymous `quote` object.
      parameters:
        - name: qid
          in: path
          description: ID of quote to update
          required: true
          type: string
        - name: quote
          in: body
          description: The quote JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/UpdateAnonQuote'
      responses:
        200:
          description: Updates a quote
      tags:
        - Quotes

    get:
      description: Returns a quote for anonymous user
      parameters:
        - name: qid
          in: path
          description: ID of quote to fetch
          required: true
          type: string
      responses:
        '200':
          description: quote response
          schema:
            $ref: '#/definitions/AnonQuote'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Quotes


  /users/{id}/wishlist:
    post:
      description: |
        Creates `wishlist` object.
      parameters:
        - name: id
          in: path
          description: ID of user to create a wishlist entry
          required: true
          type: string
        - name: wishlist
          in: body
          description: The wishlist JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/NewWishlist'
      responses:
        200:
          description: Creates a Wishlist entry, returns location of User
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Wishlist

  /users/{id}/wishlist/{pid}:
    delete:
      description: |
        Removes `wishlist` object for specified program.
      parameters:
        - name: id
          in: path
          description: ID of user to remove wishlist entry
          required: true
          type: string
        - name: pid
          in: path
          description: ID of program to remove from wishlist
          required: true
          type: string
     responses:
        200:
          description: Program removed fom wishlist, returns location of User
      tags:
        - Wishlist




  /users/{id}/enrollments:
    post:
      description: |
        Finalizes a quote and creates an 'enrollment' object.
      parameters:
        - name: id
          in: path
          description: ID of user to create an enrollment
          required: true
          type: string
        - name: enrollmentheader
          in: body
          description: The enrollment header containing the quote id and payment info
          required: true
          schema:
            $ref: '#/definitions/EnrollmentHeader'
      responses:
        200:
          description: Creates an enrollment
         schema:
            $ref: '#/definitions/Enrollment'

      tags:
        - Enrollments

  /users/{id}/enrollments/{eid}:
    get:
      description: Returns an enrollment for a user
      parameters:
        - name: id
          in: path
          description: ID of user to fetch
          required: true
          type: string
        - name: eid
          in: path
          description: ID of enrollment to fetch
          required: true
          type: string
        - name: fields
          in: query
          description: Comma delimited list of fields
          required: false
          type: string
        - name: embed
          in: query
          description: Comma delimited list of embedded objects
          required: false
         type: string
      responses:
        '200':
          description: enrollment response
          schema:
            $ref: '#/definitions/Enrollment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Enrollments

  /users/{id}/enrollments/{eid}/payments:
    post:
      description: Creates a payment for an enrollment
      parameters:
        - name: id
          in: path
          description: ID of user to create a payment
          required: true
          type: string
        - name: eid
          in: path
          description: ID of enrollment to create payment
          required: true
          type: string
        - name: payment
          in: body
          description: The payment JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/NewPayment'
      responses:
        200:
          description: Creates a payment for an enrollment, returns location of enrollment
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Enrollments

  /users/{id}/donations:
    post:
      description: |
        Posts a donation.
      parameters:
        - name: id
          in: path
          description: ID of user to post donation
          required: true
          type: string
        - name: donation
          in: body
          description: The donation JSON to post
          required: true
          schema:
            $ref: '#/definitions/NewDonation'
      responses:
        200:
          description: Donation posted
          schema:
            $ref: '#/definitions/Donation'

      tags:
        - Donations

definitions:
  User:
    properties:
      Id:
        type: string
      GivenName:
        type: string
      Surname:
        type: string
      MiddleName:
        type: string
      LegalFirstName:
        type: string
      LegalMiddleName:
        type: string
      LegalLastName:
        type: string
      LegalidType:
        type: string
        description: LOV=ID_SOURCE, examples="US Driver's License", "US State Id"
      Email:
        type: string
      StudentId:
        type: string
      Ethnicity:
        type: string
      Dob:
        type: string
        description: mm/dd/yyyy
        format: date
      Gender:
        type: string
        enum: [
              "Male",
              "Female"
            ]
      EmailOptin:
        type: string
        enum: [
              "Y",
              "N",
              "Weekly"
            ]
      LikeNorthAmericanPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      LikeInternationalPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      LikeAfloatPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      Nickname:
        type: string
        maxLength: 50
      Prefix:
        type: string
        description: LOV=MR_MS, examples="Mr.", "Mrs."
      ReviewPrivacy:
        type: string
        enum: [
              "Y",
              "N"
            ]
      Suffix:
        type: string
        description: LOV=FINS_SUFFIX_MLOV, examples="Jr.", "Sr."
      Wishlist:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/WishlistGet'
          }

  UpdateUser:
    required:
    - GivenName
    - Surname
    properties:
      GivenName:
        type: string
        maxLength: 50
      Surname:
        type: string
        maxLength: 50
      MiddleName:
        type: string
        maxLength: 50
      LegalFirstName:
        type: string
        maxLength: 30
      LegalMiddleName:
        type: string
        maxLength: 30
      LegalLastName:
        type: string
        maxLength: 30
      LegalIdType:
        type: string
        description: LOV=ID_SOURCE, examples="US Driver's License", "US State Id"
      Email:
        type: string
        maxLength: 350
      Ethnicity:
        type: string
        description: LOV=RACE, examples="Black or African American", "White"
      Dob:
        type: string
        description: mm/dd/yyyy
        format: date
      Gender:
        type: string
        enum: [
              "Male",
              "Female"
            ]
      EmailOptin:
        type: string
        enum: [
              "Y",
              "N",
              "Weekly"
            ]
      LikeNorthAmericanPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      LikeInternationalPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      LikeAfloatPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      Nickname:
        type: string
        maxLength: 50
      Prefix:
        type: string
        description: LOV=MR_MS, examples="Mr.", "Mrs."
      ReviewPrivacy:
        type: string
        enum: [
              "Y",
              "N"
            ]
      Suffix:
        type: string
        description: LOV=FINS_SUFFIX_MLOV, examples="Jr.", "Sr."


  NewUser:
    required:
    - Email
    properties:
      Email:
        type: string
        maxLength: 350
      IdmAuthId:
        type: string

  Account:
    properties:
      Id:
        type: string
      Name:
        type: string
      Salutation:
        type: string
      Sourcecode:
        type: string
      Addresses:
        type: array
        items: {
          $ref: '#/definitions/Address'
          }
      Users:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/Pointer'
          }
      Enrollments:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/Enrollment'
          }
      Vouchers:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/Voucher'
          }
      Quotes:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/QuoteAccountGet'
          }
      Donations:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/Donation'
          }

  AccountUpdate:
    required:
    - Name
    - Salutation
    - Sourcecode
    properties:
      Name:
        type: string
        maxLength: 100
      Salutation:
        type: string
        maxLength: 50
      Sourcecode:
        type: string
        maxLength: 30


  Enrollment:
    properties:
      Id:
        type: string
      OrderNumber:
        type: string
      GatewayId:
        type: string
      GatewayName:
        type: string
      Lodging:
        type: string
      Travelers:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/EnrollmentTraveler'
          }
      Preparations:
        type: array
        description: Only this array will be returned on /user/{id}/account GET
        description: optional=embed
        items: {
          $ref: '#/definitions/Preparation'
          }
      CustomFlightAirportCode:
        type: string
      TotalCost:
        type: number
      RemainingBalance:
        type: number
      PaymentHistory:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/PaymentInfo'
          }
      Program:
        description: optional=embed
        $ref: '#/definitions/Program'

  EnrollmentHeader:
    required:
    - QuoteId
    - PaymentInfo
    properties:
      QuoteId:
        type: string
      PaymentInfo:
        $ref: '#/definitions/NewPaymentWithVoucher'


  PaymentInfo:
    properties:
      Authid:
        type: string
      Date:
        type: string
      PaymentAmt:
        type: integer
      VoucherAmt:
        type: integer

  NewPayment:
    required:
    - AuthId
    - PaymentAmt
    properties:
      AuthId:
        type: string
      DonationAmt:
        type: integer
      PaymentAmt:
        type: integer

  NewPaymentWithVoucher:
    required:
    - AuthId
    - PaymentAmt
    properties:
      AuthId:
        type: string
      DonationAmt:
        type: integer
      PaymentAmt:
        type: integer
      RedeemedVoucherId:
        type: string

  Voucher:
    properties:
      Id:
        type: string
      Amount:
        type: integer

  Program:
    properties:
      Id:
        type: string
      Name:
        type: string
      Number:
        type: string
      Description:
        type: string
      StartDate:
        type: string
        description: mm/dd/yyyy
        format: date
      EndDate:
        type: string
        description: mm/dd/yyyy
        format: date

  QuoteAccountGet:
    properties:
      Id:
        type: string
      ProgramDateId:
        type: string
      ProgramNumber:
        type: string
      MailCode:
        type: string
      Location:
        type: string

  Quote:
    properties:
      Id:
        type: string
      ProgramDateId:
        type: string
      ProgramNumber:
        type: string
      MailCode:
        type: string
      GateWayId:
        type: string
      Location:
        type: string
      LodgingId:
        type: string
     Travelers:
        type: array
        description: optional=embed
        items: {
          $ref: '#/definitions/Traveler'
          }
      CustomFlightAirportCode:
        type: string
      SuggestedDonation:
        type: number
        description: optional=field

  NewQuote:
    required:
    - ProgramDateId
    - MailCode
    - LodgingId
    properties:
      CustomFlightAirportCode:
        type: string
      GatewayId:
        type: string
      LodgingId:
        type: string
      MailCode:
        type: string
        maxLength: 30
      ProgramDateId:
        type: string

  UpdateQuote:
    required:
    - ProgramDateId
    - LodgingId
    properties:
      ProgramDateId:
        type: string
      GatewayId:
        type: string
      LodgingId:
        type: string
      CustomFlightAirportCode:
        type: string

  TravelersArray:
    properties:
      Travelers:
        type: array
        items: {
          $ref: '#/definitions/Traveler'
          }



  Traveler:
    required:
    - UserId
    properties:
      UserId:
        type: string
      MealOption:
        type: string
        description: LOV=SIF_MEAL_CODE, examples="Low Fat", "Low Salt"
      SeatingOption:
        type: string
      RoommatePref:
        type: string
        maxLength: 50

  UpdateTraveler:
    properties:
      MealOption:
        type: string
        description: LOV=SIF_MEAL_CODE, examples="Low Fat", "Low Salt"
      SeatingOption:
        type: string
      RoommatePref:
        type: string
        maxLength: 50

  EnrollmentTraveler:
    required:
    - UserId
    properties:
      UserId:
        type: string
      MealOption:
        type: string
        description: LOV=SIF_MEAL_CODE, examples="Low Fat", "Low Salt"
      SeatingOption:
        type: string
      RoommatePref:
        type: string
        maxLength: 50



  NewAnonQuote:
    required:
    - WebsiteUserIdentifier
    - ProgramDateId
    - MailCode
    properties:
      WebsiteUserIdentifier:
        type: string
      ProgramDateId:
        type: string
      MailCode:
        type: string
        maxLength: 30
      GatewayId:
        type: string


  UpdateAnonQuote:
    properties:
      UserId:
        type: string
        description: pass user id to convert quote from anonymous to account
      ProgramDateId:
        type: string
      GatewayId:
        type: string
      LodgingId:
        type: string
      CustomFlightAirportCode:
        type: string


  AnonQuote:
    properties:
      Id:
        type: string
      ProgramDateId:
        type: string
      MailCode:
        type: string
      GatewayId:
        type: string
      LodgingId:
        type: string


  Preparation:
    properties:
      UserId:
        type: string
      Name:
        type: string
      DueDate:
        type: string
      Status:
        type: string
      Url:
        type: string

  Donation:
    required:
    - Amount
    properties:
      Id:
        type: string
      Amount:
        type: number
      Date:
        type: string
        description: mm/dd/yyyy
        format: date
      Authid:
        type: string
      Tribute:
        $ref: '#/definitions/Tribute'
      Purpose:
        type: string
      MailCode:
        type: string

  NewDonation:
    required:
    - Amount
    properties:
      Amount:
        type: integer
      Authid:
        type: string
      Tribute:
        $ref: '#/definitions/Tribute'
      Purpose:
        type: string
        description: LOV=HH_DON_CLASS, examples="Where needed most", "Scholarships"
      Mailcode:
        type: string
        maxLength: 30
      ReceipteMail:
        type: string
        enum: [
              "",
              "Y"
            ]
      ReceiptMail:
        type: string
        enum: [
              "",
              "Y"
            ]


  Tribute:
    properties:
      Type:
        type: string
        enum: [
          "In honor of",
          "In memory of"
          ]
      TributeName:
        type: string
        description: who the tribute is in honor or memory of
      FirstName:
        type: string
        description: first name of who will receive notification of donation
      LastName:
        type: string
        description: last name of who will receive notification of donation
      Street:
        type: string
        description: address of who will receive notification of donation
      City:
        type: string
        description: address of who will receive notification of donation
      State:
        type: string
        description: address of who will receive notification of donation
      Zip:
        type: string
        description: address of who will receive notification of donation

  Address:
    properties:
      Id:
        type: string
      AddressName:
        type: string
      City:
        type: string
      State:
        type: string
      Country:
        type: string
      Phone:
        type: string
      Ext:
        type: string
      Zip:
        type: string
      Validfrom:
        type: string
        description: mm/dd/yyyy
        format: date
      Validto:
        type: string
        description: mm/dd/yyyy
        format: date
      EveryYear:
        type: string
        format: boolean

  UpdateAddress:
    required:
    - AddressName
    - City
    - Country
    properties:
      AddressName:
        type: string
        maxLength: 200
      City:
        type: string
        maxLength: 50
      State:
        type: string
        description: LOV=STATE_ABBREV, examples="MA", "NY"
      Country:
        type: string
        description: LOV=COUNTRY, examples="USA", "Canada"
      Phone:
        type: string
        maxLength: 40
        description: phone and ext combined can be 40 chars max
      Ext:
        type: string
        description: phone and ext combined can be 40 chars max
      Zip:
        type: string
        maxLength: 30
      ValidFrom:
        type: string
        description: mm/dd/yyyy
        format: date
      ValidTo:
        type: string
        description: mm/dd/yyyy
        format: date
      EveryYear:
        type: string
        format: boolean


  WishlistGet:
    required:
      - ProgramId
    properties:
      ProgramId:
        type: string
        description: Id of the program on the wishlist

  NewWishlist:
    required:
      - ProgramId
    properties:
      ProgramId:
        type: string
        description: Id of the program to add to the wishlist



  Pointer:
    properties:
      Id:
        type: string
      Location:
        type: string

  ErrorModel:
    required:
      - Code
      - Message
    properties:
      Code:
        type: integer
        format: int32
      Message:
        type: string

From: Mohsen Azimi [mailto:[email protected]]
Sent: Tuesday, September 01, 2015 3:13 PM
To: swagger-api/swagger-editor [email protected]
Cc: Hua Wu [email protected]
Subject: Re: [swagger-editor] http://editor.swagger.io/ Can't genearte sever and client code (#616)

Which server and client generators did you try? I don't see any error with Uber example when I try it.

You can't attach files to GitHub issues. Please paste your Swagger here.


Reply to this email directly or view it on GitHubhttps://github.com/swagger-api/swagger-editor/issues/616#issuecomment-136831174.

@mohsen1
Copy link
Author

mohsen1 commented Sep 1, 2015

There was some indentation issues which I fixed, here is the fixed. Here is fixed version below.

@webron

# Example YAML to get you started quickly.
# Be aware that YAML has indentation based scoping.
# Code completion support is available so start typing for available options.
swagger: '2.0'

# This is your document metadata
info:
  version: "1.0.10"
  title: Road Scholar
  description: API for Road Scholar website
schemes:
  - http
  - https
consumes:
  - application/json
  - text/xml
produces:
  - application/json
  - text/html
paths:
  /users:
    post:
      summary: Creates user
      description: |
        Creates a new user in Siebel along with an empty account or may return existing account. Email must be verified.
      parameters:
        - name: user
          in: body
          description: User object that needs to be created
          schema:
            $ref: '#/definitions/NewUser'
          required: true
      responses:
        200:
          description: successful operation
          schema:
            $ref: '#/definitions/Pointer'
        405:
          description: Invalid input
      tags:
        - Users

  /users/{id}:
    put:
      summary: Update user
      description: |
        Updates `user` object.
      parameters:
        - name: id
          in: path
          description: ID of user to update
          required: true
          type: string
        -
          name: user
          in: body
          description: User object that needs to be updated
          required: true
          schema:
            $ref: '#/definitions/UpdateUser'
      responses:
        200:
          description: successful operation
        405:
          description: Validation exception
        404:
          description: User not found
        403:
          description: Permission denied
        400:
          description: Invalid ID supplied
      tags:
        - Users


    get:
      summary: Get user
      description: Returns a user based on a single ID
      operationId: findUserById
      parameters:
        - name: id
          in: path
          description: ID of user to fetch
          required: true
          type: string
      responses:
        200:
          description: user response
          schema:
            $ref: '#/definitions/User'
        404:
          description: User not found
        403:
          description: Permission denied
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Users

  /users/{id}/account:
    get:
      description: Returns a user account
      parameters:
        - name: id
          in: path
          description: ID of user to fetch account for
          required: true
          type: string
        - name: fields
          in: query
          description: Comma delimited list of fields
          required: false
          type: string
        - name: embed
          in: query
          description: Comma delimited list of embedded objects
          required: false
          type: string
      responses:
        '200':
          description: account response depends on fields/embed
          schema:
            $ref: '#/definitions/Account'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Accounts
    put:
      description: |
        Updates `account` object.
      parameters:
        - name: id
          in: path
          description: ID of user to update account for
          required: true
          type: string
        - name: account
          in: body
          description: The account JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/AccountUpdate'
      responses:
        200:
          description: Updates a account
      tags:
        - Accounts

  /users/{id}/account/users:
    post:
      description: |
        Creates a new user for the account.
      parameters:
        - name: id
          in: path
          description: ID of user to update account for
          required: true
          type: string
        - name: user
          in: body
          description: User object that needs to be updated
          required: true
          schema:
            $ref: '#/definitions/UpdateUser'
      responses:
        200:
          description: successful operation
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Accounts

  /users/{id}/account/addresses:
    post:
      description: |
        Creates `address` object.
      parameters:
        - name: id
          in: path
          description: ID of user to create an address
          required: true
          type: string
        - name: address
          in: body
          description: The address JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/UpdateAddress'
      responses:
        200:
          description: Creates an address
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Address
  /users/{id}/account/addresses/{addrid}:
    put:
      description: |
        Updates `Address` object.
      parameters:
        - name: id
          in: path
          description: ID of user to update Address for
          required: true
          type: string
        - name: addrid
          in: path
          description: ID of Address to update
          required: true
          type: string
        - name: address
          in: body
          description: The address JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/UpdateAddress'
      responses:
        200:
          description: Updates an address
      tags:
        - Address


  /users/{id}/quotes:
    post:
      description: |
        Creates `quote` object.
      parameters:
        - name: id
          in: path
          description: ID of user to create a quote
          required: true
          type: string
        - name: quote
          in: body
          description: The quote JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/NewQuote'
      responses:
        200:
          description: Creates a quote
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Quotes

  /users/{id}/quotes/{qid}:
    put:
      description: |
        Updates `quote` object.
      parameters:
        - name: id
          in: path
          description: ID of user to update quote for
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote you want to update
          required: true
          type: string
        - name: quote
          in: body
          description: The quote JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/UpdateQuote'
      responses:
        200:
          description: Updates a quote
      tags:
        - Quotes

    get:
      description: Returns a quote for a user
      parameters:
        - name: id
          in: path
          description: ID of user to fetch
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote to fetch
          required: true
          type: string
        - name: fields
          in: query
          description: Comma delimited list of fields
          required: false
          type: string
        - name: embed
          in: query
          description: Comma delimited list of embedded objects
          required: false
          type: string
      responses:
        '200':
          description: quote response
          schema:
            $ref: '#/definitions/Quote'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Quotes

  /users/{id}/quotes/{qid}/travelers:
    post:
      description: |
        Creates `traveler` object for a quote.
      parameters:
        - name: id
          in: path
          description: ID of user to create traveler
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote to create traveler
          required: true
          type: string
        - name: travelers
          in: body
          description: The array of travelers JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/TravelersArray'
      responses:
        200:
          description: Creates a traveler, returns location to quote
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Quotes

  /users/{id}/quotes/{qid}/travelers/{travuid}:
    put:
      description: |
        Updates `traveler` object for a quote.
      parameters:
        - name: id
          in: path
          description: ID of user to update traveler
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote to update traveler
          required: true
          type: string
        - name: travuid
          in: path
          description: ID of traveler to update
          required: true
          type: string
        - name: traveler
          in: body
          description: The traveler JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/UpdateTraveler'
      responses:
        200:
          description: Updates a traveler
      tags:
        - Quotes

    delete:
      description: |
        Removes `traveler` object from quote.
      parameters:
        - name: id
          in: path
          description: ID of user to removes traveler
          required: true
          type: string
        - name: qid
          in: path
          description: ID of quote to remove traveler
          required: true
          type: string
        - name: travuid
          in: path
          description: ID of traveler to remove
          required: true
          type: string
      responses:
        200:
          description: traveler removed
      tags:
        - Quotes



  /anon/quotes:
    post:
      description: |
        Creates `quote` object for anonymous user
      parameters:
        - name: quote
          in: body
          description: The quote JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/NewAnonQuote'
      responses:
        200:
          description: Creates a quote, returns location of /anon/quote
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Quotes

  /anon/quotes/{qid}:
    put:
      description: |
        Updates anonymous `quote` object.
      parameters:
        - name: qid
          in: path
          description: ID of quote to update
          required: true
          type: string
        - name: quote
          in: body
          description: The quote JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/UpdateAnonQuote'
      responses:
        200:
          description: Updates a quote
      tags:
        - Quotes

    get:
      description: Returns a quote for anonymous user
      parameters:
        - name: qid
          in: path
          description: ID of quote to fetch
          required: true
          type: string
      responses:
        '200':
          description: quote response
          schema:
            $ref: '#/definitions/AnonQuote'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Quotes


  /users/{id}/wishlist:
    post:
      description: |
        Creates `wishlist` object.
      parameters:
        - name: id
          in: path
          description: ID of user to create a wishlist entry
          required: true
          type: string
        - name: wishlist
          in: body
          description: The wishlist JSON you want to post
          required: true
          schema:
            $ref: '#/definitions/NewWishlist'
      responses:
        200:
          description: Creates a Wishlist entry, returns location of User
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Wishlist

  /users/{id}/wishlist/{pid}:
    delete:
      description: |
        Removes `wishlist` object for specified program.
      parameters:
        - name: id
          in: path
          description: ID of user to remove wishlist entry
          required: true
          type: string
        - name: pid
          in: path
          description: ID of program to remove from wishlist
          required: true
          type: string
      responses:
        200:
          description: Program removed fom wishlist, returns location of User
      tags:
        - Wishlist

  /users/{id}/enrollments:
    post:
      description: |
        Finalizes a quote and creates an 'enrollment' object.
      parameters:
        - name: id
          in: path
          description: ID of user to create an enrollment
          required: true
          type: string
        - name: enrollmentheader
          in: body
          description: The enrollment header containing the quote id and payment info
          required: true
          schema:
            $ref: '#/definitions/EnrollmentHeader'
      responses:
        200:
          description: Creates an enrollment
          schema:
            $ref: '#/definitions/Enrollment'

      tags:
        - Enrollments

  /users/{id}/enrollments/{eid}:
    get:
      description: Returns an enrollment for a user
      parameters:
        - name: id
          in: path
          description: ID of user to fetch
          required: true
          type: string
        - name: eid
          in: path
          description: ID of enrollment to fetch
          required: true
          type: string
        - name: fields
          in: query
          description: Comma delimited list of fields
          required: false
          type: string
        - name: embed
          in: query
          description: Comma delimited list of embedded objects
          required: false
          type: string
      responses:
        '200':
          description: enrollment response
          schema:
            $ref: '#/definitions/Enrollment'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/ErrorModel'
      tags:
        - Enrollments

  /users/{id}/enrollments/{eid}/payments:
    post:
      description: Creates a payment for an enrollment
      parameters:
        - name: id
          in: path
          description: ID of user to create a payment
          required: true
          type: string
        - name: eid
          in: path
          description: ID of enrollment to create payment
          required: true
          type: string
        - name: payment
          in: body
          description: The payment JSON you want to put
          required: true
          schema:
            $ref: '#/definitions/NewPayment'
      responses:
        200:
          description: Creates a payment for an enrollment, returns location of enrollment
          schema:
            $ref: '#/definitions/Pointer'
      tags:
        - Enrollments

  /users/{id}/donations:
    post:
      description: |
        Posts a donation.
      parameters:
        - name: id
          in: path
          description: ID of user to post donation
          required: true
          type: string
        - name: donation
          in: body
          description: The donation JSON to post
          required: true
          schema:
            $ref: '#/definitions/NewDonation'
      responses:
        200:
          description: Donation posted
          schema:
            $ref: '#/definitions/Donation'

      tags:
        - Donations

definitions:
  User:
    properties:
      Id:
        type: string
      GivenName:
        type: string
      Surname:
        type: string
      MiddleName:
        type: string
      LegalFirstName:
        type: string
      LegalMiddleName:
        type: string
      LegalLastName:
        type: string
      LegalidType:
        type: string
        description: LOV=ID_SOURCE, examples="US Driver's License", "US State Id"
      Email:
        type: string
      StudentId:
        type: string
      Ethnicity:
        type: string
      Dob:
        type: string
        description: mm/dd/yyyy
        format: date
      Gender:
        type: string
        enum: [
              "Male",
              "Female"
            ]
      EmailOptin:
        type: string
        enum: [
              "Y",
              "N",
              "Weekly"
            ]
      LikeNorthAmericanPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      LikeInternationalPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      LikeAfloatPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      Nickname:
        type: string
        maxLength: 50
      Prefix:
        type: string
        description: LOV=MR_MS, examples="Mr.", "Mrs."
      ReviewPrivacy:
        type: string
        enum: [
              "Y",
              "N"
            ]
      Suffix:
        type: string
        description: LOV=FINS_SUFFIX_MLOV, examples="Jr.", "Sr."
      Wishlist:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/WishlistGet'
          }

  UpdateUser:
    required:
    - GivenName
    - Surname
    properties:
      GivenName:
        type: string
        maxLength: 50
      Surname:
        type: string
        maxLength: 50
      MiddleName:
        type: string
        maxLength: 50
      LegalFirstName:
        type: string
        maxLength: 30
      LegalMiddleName:
        type: string
        maxLength: 30
      LegalLastName:
        type: string
        maxLength: 30
      LegalIdType:
        type: string
        description: LOV=ID_SOURCE, examples="US Driver's License", "US State Id"
      Email:
        type: string
        maxLength: 350
      Ethnicity:
        type: string
        description: LOV=RACE, examples="Black or African American", "White"
      Dob:
        type: string
        description: mm/dd/yyyy
        format: date
      Gender:
        type: string
        enum: [
              "Male",
              "Female"
            ]
      EmailOptin:
        type: string
        enum: [
              "Y",
              "N",
              "Weekly"
            ]
      LikeNorthAmericanPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      LikeInternationalPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      LikeAfloatPrograms:
        type: string
        enum: [
              "Y",
              "N"
            ]
      Nickname:
        type: string
        maxLength: 50
      Prefix:
        type: string
        description: LOV=MR_MS, examples="Mr.", "Mrs."
      ReviewPrivacy:
        type: string
        enum: [
              "Y",
              "N"
            ]
      Suffix:
        type: string
        description: LOV=FINS_SUFFIX_MLOV, examples="Jr.", "Sr."


  NewUser:
    required:
    - Email
    properties:
      Email:
        type: string
        maxLength: 350
      IdmAuthId:
        type: string

  Account:
    properties:
      Id:
        type: string
      Name:
        type: string
      Salutation:
        type: string
      Sourcecode:
        type: string
      Addresses:
        type: array
        items: {
          $ref: '#/definitions/Address'
          }
      Users:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/Pointer'
          }
      Enrollments:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/Enrollment'
          }
      Vouchers:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/Voucher'
          }
      Quotes:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/QuoteAccountGet'
          }
      Donations:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/Donation'
          }

  AccountUpdate:
    required:
    - Name
    - Salutation
    - Sourcecode
    properties:
      Name:
        type: string
        maxLength: 100
      Salutation:
        type: string
        maxLength: 50
      Sourcecode:
        type: string
        maxLength: 30


  Enrollment:
    properties:
      Id:
        type: string
      OrderNumber:
        type: string
      GatewayId:
        type: string
      GatewayName:
        type: string
      Lodging:
        type: string
      Travelers:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/EnrollmentTraveler'
          }
      Preparations:
        type: array
        description: Only this array will be returned on /user/{id}/account GET
        description: optional=embed
        items: {
          $ref: '#/definitions/Preparation'
          }
      CustomFlightAirportCode:
        type: string
      TotalCost:
        type: number
      RemainingBalance:
        type: number
      PaymentHistory:
        type: array
        description: optional=field/embed
        items: {
          $ref: '#/definitions/PaymentInfo'
          }
      Program:
        description: optional=embed
        $ref: '#/definitions/Program'

  EnrollmentHeader:
    required:
    - QuoteId
    - PaymentInfo
    properties:
      QuoteId:
        type: string
      PaymentInfo:
        $ref: '#/definitions/NewPaymentWithVoucher'


  PaymentInfo:
    properties:
      Authid:
        type: string
      Date:
        type: string
      PaymentAmt:
        type: integer
      VoucherAmt:
        type: integer

  NewPayment:
    required:
    - AuthId
    - PaymentAmt
    properties:
      AuthId:
        type: string
      DonationAmt:
        type: integer
      PaymentAmt:
        type: integer

  NewPaymentWithVoucher:
    required:
    - AuthId
    - PaymentAmt
    properties:
      AuthId:
        type: string
      DonationAmt:
        type: integer
      PaymentAmt:
        type: integer
      RedeemedVoucherId:
        type: string

  Voucher:
    properties:
      Id:
        type: string
      Amount:
        type: integer

  Program:
    properties:
      Id:
        type: string
      Name:
        type: string
      Number:
        type: string
      Description:
        type: string
      StartDate:
        type: string
        description: mm/dd/yyyy
        format: date
      EndDate:
        type: string
        description: mm/dd/yyyy
        format: date

  QuoteAccountGet:
    properties:
      Id:
        type: string
      ProgramDateId:
        type: string
      ProgramNumber:
        type: string
      MailCode:
        type: string
      Location:
        type: string

  Quote:
    properties:
      Id:
        type: string
      ProgramDateId:
        type: string
      ProgramNumber:
        type: string
      MailCode:
        type: string
      GateWayId:
        type: string
      Location:
        type: string
      LodgingId:
        type: string
      Travelers:
        type: array
        description: optional=embed
        items: {
          $ref: '#/definitions/Traveler'
          }
      CustomFlightAirportCode:
        type: string
      SuggestedDonation:
        type: number
        description: optional=field

  NewQuote:
    required:
    - ProgramDateId
    - MailCode
    - LodgingId
    properties:
      CustomFlightAirportCode:
        type: string
      GatewayId:
        type: string
      LodgingId:
        type: string
      MailCode:
        type: string
        maxLength: 30
      ProgramDateId:
        type: string

  UpdateQuote:
    required:
    - ProgramDateId
    - LodgingId
    properties:
      ProgramDateId:
        type: string
      GatewayId:
        type: string
      LodgingId:
        type: string
      CustomFlightAirportCode:
        type: string

  TravelersArray:
    properties:
      Travelers:
        type: array
        items: {
          $ref: '#/definitions/Traveler'
          }



  Traveler:
    required:
    - UserId
    properties:
      UserId:
        type: string
      MealOption:
        type: string
        description: LOV=SIF_MEAL_CODE, examples="Low Fat", "Low Salt"
      SeatingOption:
        type: string
      RoommatePref:
        type: string
        maxLength: 50

  UpdateTraveler:
    properties:
      MealOption:
        type: string
        description: LOV=SIF_MEAL_CODE, examples="Low Fat", "Low Salt"
      SeatingOption:
        type: string
      RoommatePref:
        type: string
        maxLength: 50

  EnrollmentTraveler:
    required:
    - UserId
    properties:
      UserId:
        type: string
      MealOption:
        type: string
        description: LOV=SIF_MEAL_CODE, examples="Low Fat", "Low Salt"
      SeatingOption:
        type: string
      RoommatePref:
        type: string
        maxLength: 50



  NewAnonQuote:
    required:
    - WebsiteUserIdentifier
    - ProgramDateId
    - MailCode
    properties:
      WebsiteUserIdentifier:
        type: string
      ProgramDateId:
        type: string
      MailCode:
        type: string
        maxLength: 30
      GatewayId:
        type: string


  UpdateAnonQuote:
    properties:
      UserId:
        type: string
        description: pass user id to convert quote from anonymous to account
      ProgramDateId:
        type: string
      GatewayId:
        type: string
      LodgingId:
        type: string
      CustomFlightAirportCode:
        type: string


  AnonQuote:
    properties:
      Id:
        type: string
      ProgramDateId:
        type: string
      MailCode:
        type: string
      GatewayId:
        type: string
      LodgingId:
        type: string


  Preparation:
    properties:
      UserId:
        type: string
      Name:
        type: string
      DueDate:
        type: string
      Status:
        type: string
      Url:
        type: string

  Donation:
    required:
    - Amount
    properties:
      Id:
        type: string
      Amount:
        type: number
      Date:
        type: string
        description: mm/dd/yyyy
        format: date
      Authid:
        type: string
      Tribute:
        $ref: '#/definitions/Tribute'
      Purpose:
        type: string
      MailCode:
        type: string

  NewDonation:
    required:
    - Amount
    properties:
      Amount:
        type: integer
      Authid:
        type: string
      Tribute:
        $ref: '#/definitions/Tribute'
      Purpose:
        type: string
        description: LOV=HH_DON_CLASS, examples="Where needed most", "Scholarships"
      Mailcode:
        type: string
        maxLength: 30
      ReceipteMail:
        type: string
        enum: [
              "",
              "Y"
            ]
      ReceiptMail:
        type: string
        enum: [
              "",
              "Y"
            ]


  Tribute:
    properties:
      Type:
        type: string
        enum: [
          "In honor of",
          "In memory of"
          ]
      TributeName:
        type: string
        description: who the tribute is in honor or memory of
      FirstName:
        type: string
        description: first name of who will receive notification of donation
      LastName:
        type: string
        description: last name of who will receive notification of donation
      Street:
        type: string
        description: address of who will receive notification of donation
      City:
        type: string
        description: address of who will receive notification of donation
      State:
        type: string
        description: address of who will receive notification of donation
      Zip:
        type: string
        description: address of who will receive notification of donation

  Address:
    properties:
      Id:
        type: string
      AddressName:
        type: string
      City:
        type: string
      State:
        type: string
      Country:
        type: string
      Phone:
        type: string
      Ext:
        type: string
      Zip:
        type: string
      Validfrom:
        type: string
        description: mm/dd/yyyy
        format: date
      Validto:
        type: string
        description: mm/dd/yyyy
        format: date
      EveryYear:
        type: string
        format: boolean

  UpdateAddress:
    required:
    - AddressName
    - City
    - Country
    properties:
      AddressName:
        type: string
        maxLength: 200
      City:
        type: string
        maxLength: 50
      State:
        type: string
        description: LOV=STATE_ABBREV, examples="MA", "NY"
      Country:
        type: string
        description: LOV=COUNTRY, examples="USA", "Canada"
      Phone:
        type: string
        maxLength: 40
        description: phone and ext combined can be 40 chars max
      Ext:
        type: string
        description: phone and ext combined can be 40 chars max
      Zip:
        type: string
        maxLength: 30
      ValidFrom:
        type: string
        description: mm/dd/yyyy
        format: date
      ValidTo:
        type: string
        description: mm/dd/yyyy
        format: date
      EveryYear:
        type: string
        format: boolean


  WishlistGet:
    required:
      - ProgramId
    properties:
      ProgramId:
        type: string
        description: Id of the program on the wishlist

  NewWishlist:
    required:
      - ProgramId
    properties:
      ProgramId:
        type: string
        description: Id of the program to add to the wishlist



  Pointer:
    properties:
      Id:
        type: string
      Location:
        type: string

  ErrorModel:
    required:
      - Code
      - Message
    properties:
      Code:
        type: integer
        format: int32
      Message:
        type: string

@mohsen1
Copy link
Author

mohsen1 commented Sep 1, 2015

You spec is missing type: object in definitions. Although it's valid codegen doesn't like it. Try updating your spec with this change and let us know what happened.

@webron If type: object is not required per schema, codegen should work without it. I would say it's a bug that it fails without type: object in definitions

@huaw
Copy link

huaw commented Sep 1, 2015

Which line have indentation issues? I can’t copy your version.

From: Mohsen Azimi [mailto:[email protected]]
Sent: Tuesday, September 01, 2015 3:39 PM
To: swagger-api/swagger-codegen [email protected]
Cc: Hua Wu [email protected]
Subject: Re: [swagger-codegen] http://editor.swagger.io/ Can't genearte sever and client code (#1170)

You spec is missing type: object in definitions. Although it's valid codegen doesn't like it. Try updating your spec with this change and let us know what happened.

@webronhttps://github.com/webron If type: object is not required per schema, codegen should work without it. I would say it's a bug that it fails without type: object in definitions


Reply to this email directly or view it on GitHubhttps://github.com//issues/1170#issuecomment-136836693.

@fehguy
Copy link
Contributor

fehguy commented Sep 1, 2015

@mohsen1 @huaw agree codegen shouldn't be puking on this. Will get this handled.

@huaw
Copy link

huaw commented Sep 1, 2015

Thanks for helping here.

How can I get this yaml file working? I am still confused.

From: Tony Tam [mailto:[email protected]]
Sent: Tuesday, September 01, 2015 4:20 PM
To: swagger-api/swagger-codegen [email protected]
Cc: Hua Wu [email protected]
Subject: Re: [swagger-codegen] http://editor.swagger.io/ Can't genearte sever and client code (#1170)

@mohsen1https://github.com/mohsen1 @huawhttps://github.com/huaw agree codegen shouldn't be puking on this. Will get this handled.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1170#issuecomment-136849353.

@huaw
Copy link

huaw commented Sep 2, 2015

@webron
Sorry I can’t get this working. Even I try to add type:object for those refs.

From: Mohsen Azimi [mailto:[email protected]]
Sent: Tuesday, September 01, 2015 3:39 PM
To: swagger-api/swagger-codegen [email protected]
Cc: Hua Wu [email protected]
Subject: Re: [swagger-codegen] http://editor.swagger.io/ Can't genearte sever and client code (#1170)

You spec is missing type: object in definitions. Although it's valid codegen doesn't like it. Try updating your spec with this change and let us know what happened.

@webronhttps://github.com/webron If type: object is not required per schema, codegen should work without it. I would say it's a bug that it fails without type: object in definitions


Reply to this email directly or view it on GitHubhttps://github.com//issues/1170#issuecomment-136836693.

@webron
Copy link
Contributor

webron commented Sep 3, 2015

While I agree the codegen shouldn't die if there's no type: object, it's not an easy case to handle. If we do go ahead and assume that the type is object because there is a properties property (which is pretty much wrong), we need to add a disclaimer both in the README and while generating the code that it was assumed.

@mohsen1
Copy link
Author

mohsen1 commented Sep 3, 2015

Why relying to properties existence is wrong?

@webron
Copy link
Contributor

webron commented Sep 3, 2015

Because that's how JSON Schema works. If there's no type: object, any type would apply. properties is applicable only if the type is object. It's not the other way around.

@ahaid
Copy link

ahaid commented Oct 1, 2015

Any update on this?

I'm getting a "something bad happened" error when trying to generate any server or client. I verifired all my definitions contain type: object.

@wing328
Copy link
Contributor

wing328 commented Oct 12, 2015

@ahaid do you mind sharing your swagger spec with us to reproduce the issue?

@mach-kernel
Copy link

I found another way to make it die.

A path definition such as this one will cause it to 500:

  /foo/bar:
    post:
      summary: baz
      description: |
        blap
      parameters: 
        - name: sample
          in: body
          description: bloop
          schema:
            type: object
            properties:
              filename: 
                type: string
              data:
                type: string
                format: file
          required: true
      tags: 
        - Samples
      responses:
        201:
          description: The ID of the newly created resource
          schema:
            type: string

Removing the data property from the object, or the format: file descriptor will fix the issue.

@fehguy
Copy link
Contributor

fehguy commented Oct 18, 2015

{
  "type": "string",
  "format": "file"
}

Doesn't make any sense. Take a look at the spec for supported types.

@fehguy
Copy link
Contributor

fehguy commented Oct 26, 2015

The inline objects are now supported. Please retry, and reopen this if you have an issue.

@fehguy fehguy closed this as completed Oct 26, 2015
@fehguy fehguy modified the milestone: v2.1.4 Oct 26, 2015
@rs2015
Copy link

rs2015 commented Nov 16, 2015

screen shot 2015-11-16 at 10 06 01 am

I am getting error trying to generate node.js server. See the attached files.

@Dr0na
Copy link

Dr0na commented Dec 28, 2017

The issues still occurs as on date. Server code isn't generated with the exact same error.

@wing328
Copy link
Contributor

wing328 commented Jan 5, 2018

Please open a new issue for tracking with more details (e.g. which server generator you tried or all server generators result in the same error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants