OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.87k stars 6.59k forks source link

[BUG][typescript-angular] Attribute path error while using #ref for path parameters #2150

Closed ArchiCain closed 5 years ago

ArchiCain commented 5 years ago
Description

There is an attribute path error being thrown when using #ref for path parameters. All of my research says that this is a valid spec. Am I missing something obvious?

openapi-generator version

4.0.0-SNAPSHOT

OpenAPI declaration file content or url

member.yaml

openapi: '3.0.1'
info:
  version: '0.1'
  title: Employee API
security:
  - session: []
paths:
  /employees:
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
    post:
      operationId: createEmployee
      requestBody:
        $ref: '#/components/requestBodies/Employee'
      responses:
        '201':
          description: created
          headers:
            Location:
              description: The location of the newly created employee
              schema:
                type: string
              example: /employees/1
        '400':
          description: |
            - badParameter: validation errors
        '409':
          $ref: 'shared.yaml#/components/responses/Duplicate'
  /employees/search:
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: 'shared.yaml#/components/parameters/searchProperty'
      - $ref: 'shared.yaml#/components/parameters/searchValue'
      - $ref: 'shared.yaml#/components/parameters/sort'
      - $ref: 'shared.yaml#/components/parameters/page'
      - $ref: 'shared.yaml#/components/parameters/size'
    get:
      operationId: searchEmployees
      description: the properties available for searching should be [name.lastName]
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: 'account.yaml#/components/schemas/EmployeeListItem'
        '400':
          description: |
            - missingParameter: search parameters required
            - badParameter: invalid property
  '/employees/{employeeId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployee
      parameters:
        - $ref: '#/components/parameters/fullProfile'
      responses:
        '200':
          description: employee found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Employee'
        '404':
          description: |
            - notFound: employee not found
    put:
      operationId: updateEmployee
      requestBody:
        $ref: '#/components/requestBodies/Employee'
      responses:
        '204':
          description: successful update
        '400':
          description: |
            - badParameter: validation errors
  '/employees/{employeeId}/audit/sessionActivities':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getActivityAudits
      parameters:
        - $ref: '#/components/parameters/auditStartDate'
        - $ref: '#/components/parameters/auditEndDate'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SessionActivity'
  '/employees/{employeeId}/audit/demographics':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: 'shared.yaml#/components/parameters/page'
      - $ref: 'shared.yaml#/components/parameters/size'
    get:
      operationId: getDemographicsAudits
      parameters:
        - $ref: '#/components/parameters/auditStartDate'
        - $ref: '#/components/parameters/auditEndDate'
        - $ref: '#/components/parameters/changeType'
        - name: dependentId
          description: if not included, then it means this is for a employee
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: found
          headers:
            Total-Count:
              description: if pagination parameters are set, then we return the total number of records
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DemographicChange'
  '/employees/{employeeId}/audit/enrollments':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEnrollmentAudits
      parameters:
        - $ref: '#/components/parameters/auditStartDate'
        - $ref: '#/components/parameters/auditEndDate'
        - name: productId
          in: query
          schema:
            type: integer
        - name: recordType
          description: if not provided, then it defaults to all
          in: query
          schema:
            type: string
            enum: [ACTIVE,ARCHIVED]
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: 'enrollment.yaml#/components/schemas/Enrollment'
  '/employees/{employeeId}/contacts':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeContacts
      responses:
        '200':
          description: contacts found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EmployeeContact'
  '/employees/{employeeId}/contacts/{contactType}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/contactType'
    get:
      operationId: getEmployeeContact
      responses:
        '200':
          description: contact found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmployeeContact'
        '404':
          description: |
            - notFound: contact not found
    put:
      operationId: saveEmployeeContact
      requestBody:
        $ref: '#/components/requestBodies/EmployeeContact'
      responses:
        '204':
          description: successful update
        '400':
          description: |
            - badParameter: validation errors
  '/employees/{employeeId}/paymentMethods':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getPaymentMethods
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/BankDraftPaymentMethod'
                    - $ref: '#/components/schemas/CardPaymentMethod'
    post:
      operationId: addPaymentMethod
      parameters:
        - $ref: '#/components/parameters/overrideDuplicate'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/BankDraftPaymentMethod'
                - $ref: '#/components/schemas/CardPaymentMethod'
      responses:
        '201':
          description: created
          headers:
            Location:
              description: The location of the newly created payment method
              schema:
                type: string
              example: /paymentMethods/1
        '400':
          description: |
            - badParameter: validation errors
        '409':
          $ref: 'shared.yaml#/components/responses/Duplicate'
  '/employees/{employeeId}/paymentMethods/{paymentMethodId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getPaymentMethod
      parameters:
        - name: paymentMethodId
          in: query
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/BankDraftPaymentMethod'
                  - $ref: '#/components/schemas/CardPaymentMethod'
  '/employees/{employeeId}/salaries':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getSalaries
      parameters:
        - $ref: '#/components/parameters/masked'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Salary'
    post:
      operationId: createSalary
      requestBody:
        $ref: '#/components/requestBodies/Salary'
      responses:
        '201':
          description: created
          headers:
            Location:
              description: The location of the newly created salary
              schema:
                type: string
              example: /employees/1/salaries/1
        '400':
          description: |
            - badParameter: validation errors
  '/employees/{employeeId}/salaries/{salaryId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - name: salaryId
        in: path
        required: true
        schema:
          type: integer
    get:
      operationId: getSalary
      parameters:
        - $ref: '#/components/parameters/masked'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Salary'
        '404':
          description: |
            - notFound: salary not found
    put:
      operationId: updateSalary
      requestBody:
        $ref: '#/components/requestBodies/Salary'
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
    delete:
      operationId: deleteSalary
      responses:
        '204':
          description: salary deleted
  '/employees/{employeeId}/identifiers':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeIdentifiers
      parameters:
        - $ref: '#/components/parameters/masked'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                description: this will result in a string:string map of identifier type id to identifier value
                type: object
                additionalProperties:
                  type: string
        '403':
          description: |
            - forbidden: cannot unmask
  '/employees/{employeeId}/identifiers/{identifierTypeId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/identifierTypeId'
    get:
      operationId: getEmployeeIdentifier
      parameters:
        - $ref: '#/components/parameters/masked'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: string
        '403':
          description: |
            - forbidden: cannot unmask
        '404':
          description: |
            - notFound: identifier not found
    put:
      operationId: saveEmployeeIdentifier
      description: Since we can only have one identifier per type, this serves as both the "create" and the update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
      responses:
        '204':
          description: Successful save
        '400':
          description: |
            - badParameter: validation errors
    delete:
      operationId: deleteEmployeeIdentifier
      responses:
        '204':
          description: deleted
  '/employees/{employeeId}/dependents':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeDependents
      parameters:
        - $ref: '#/components/parameters/fullProfile'
      responses:
        '200':
          description: dependents found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Dependent'
    post:
      operationId: createEmployeeDependent
      parameters:
        - $ref: '#/components/parameters/overrideDuplicate'
      requestBody:
        $ref: '#/components/requestBodies/Dependent'
      responses:
        '201':
          description: dependent created
          headers:
            Location:
              description: The location of the newly created dependent
              schema:
                type: string
              example: /employees/1/dependents/1
        '400':
          description: |
            - badParameter: validation errors
        '409':
          $ref: 'shared.yaml#/components/responses/Duplicate'
  '/employees/{employeeId}/dependents/{dependentId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/dependentId'
    get:
      operationId: getEmployeeDependent
      parameters:
        - $ref: '#/components/parameters/fullProfile'
      responses:
        '200':
          description: dependent found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dependent'
        '404':
          description: |
            - notFound: dependent not found
    put:
      operationId: updateEmployeeDependent
      requestBody:
        $ref: '#/components/requestBodies/Dependent'
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
    delete:
      operationId: deleteEmployeeDependent
      responses:
        '204':
          description: dependent deleted
        '403':
          description: |
            - prerequisiteFailed: dependent cannot be deleted
  '/employees/{employeeId}/dependents/{dependentId}/contact':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/dependentId'
    get:
      operationId: getDependentContact
      responses:
        '200':
          description: dependent found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmployeeContact'
        '404':
          description: |
            - notFound: contact not found
    put:
      operationId: saveDependentContact
      requestBody:
        $ref: '#/components/requestBodies/EmployeeContact'
      responses:
        '204':
          description: Successful save
        '400':
          description: |
            - missingParameter: required parameter(s) missing
            - badParameter: validation errors
  '/employees/{employeeId}/dependents/{dependentId}/identifiers':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/dependentId'
    get:
      operationId: getDependentIdentifiers
      parameters:
        - $ref: '#/components/parameters/masked'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                description: this will result in a string:string map of identifier type id to identifier value
                type: object
                additionalProperties:
                  type: string
  '/employees/{employeeId}/dependents/{dependentId}/identifiers/{identifierTypeId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/dependentId'
      - $ref: '#/components/parameters/identifierTypeId'
    get:
      operationId: getDependentIdentifier
      parameters:
        - $ref: '#/components/parameters/masked'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: string
        '404':
          description: |
            - notFound: identifier not found
    put:
      operationId: saveDependentIdentifier
      description: Since we can only have one identifier per type, this serves as both the "create" and the update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
      responses:
        '204':
          description: Successful save
        '400':
          description: |
            - badParameter: validation errors
    delete:
      operationId: deleteDependentIdentifier
      responses:
        '204':
          description: deleted
  '/employees/{employeeId}/dependents/{dependentId}/qualifierTypes':
    parameters:
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/dependentId'
    get:
      operationId: getDependentQualifierTypes
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                description: this will result in a map of qualifier type id (as a string) to an array of Qualifier resources
                type: object
                additionalProperties:
                  type: array
                  items:
                    $ref: '#/components/schemas/Qualifier'
  '/employees/{employeeId}/dependents/{dependentId}/qualifierTypes/{qualifierTypeId}':
    parameters:
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/dependentId'
      - $ref: '#/components/parameters/qualifierTypeId'
    get:
      operationId: getDependentQualifierType
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Qualifier'
    post:
      operationId: saveDependentQualifier
      requestBody:
        $ref: '#/components/requestBodies/Qualifier'
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
  '/employees/{employeeId}/dependents/{dependentId}/verificationStatus':
    parameters:
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/dependentId'
    get:
      operationId: getDependentVerificationStatus
      parameters:
        - $ref: '#/components/parameters/expandDependentVerificationStatus'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DependentVerificationStatus'
  '/employees/{employeeId}/dependents/{dependentId}/approveOrRejectVerification':
    parameters:
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/dependentId'
    put:
      operationId: updateDependentVerificationStatus
      requestBody:
        content:
          application/json:
            schema:
              required: [verificationAction]
              properties:
                verificationAction:
                  type: string
                  enum: [APPROVE,REJECT]
                documentIds:
                  type: array
                  items:
                    type: integer
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
  '/employees/{employeeId}/classTypes':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeClassTypes
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                description: this will result in a map of class type id (as a string) to an array of EmployeeClass resource
                type: object
                additionalProperties:
                  type: array
                  items:
                    $ref: '#/components/schemas/EmployeeClass'
  '/employees/{employeeId}/classTypes/{classTypeId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - name: classTypeId
        in: path
        required: true
        schema:
          type: integer
    get:
      operationId: getEmployeeClassType
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EmployeeClass'
        '404':
          description: |
            - notFound: class type not found
    post:
      operationId: updateEmployeeClass
      requestBody:
        $ref: '#/components/requestBodies/EmployeeClass'
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
  '/employees/{employeeId}/regionTypes':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeRegionTypes
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                description: this will result in a map of class type id (as a string) to an array of EmployeeRegion resource
                type: object
                additionalProperties:
                  type: array
                  items:
                    $ref: '#/components/schemas/EmployeeRegion'
  '/employees/{employeeId}/regionTypes/{regionTypeId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - name: regionTypeId
        in: path
        required: true
        schema:
          type: integer
    get:
      operationId: getEmployeeRegionType
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EmployeeRegion'
        '404':
          description: |
            - notFound: class type not found
  '/employees/{employeeId}/beneficiaries':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeBeneficiaries
      parameters:
        - name: maskSsn
          in: query
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/Beneficiary'
                    - $ref: '#/components/schemas/IndividualBeneficiary'
                    - $ref: '#/components/schemas/TrustBeneficiary'
                    - $ref: '#/components/schemas/CharityBeneficiary'
        '403':
          description: |
            - forbidden: cannot unmask
    post:
      operationId: createEmployeeBeneficiary
      requestBody:
        $ref: '#/components/requestBodies/Beneficiary'
      responses:
        '201':
          description: created
          headers:
            Location:
              description: The location of the newly created beneficiary
              schema:
                type: string
              example: /employees/1/beneficiaries/1
        '400':
          description: |
            - badParameter: validation errors
        '409':
          $ref: 'shared.yaml#/components/responses/Duplicate'
  '/employees/{employeeId}/beneficiaries/{beneficiaryId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - name: beneficiaryId
        in: path
        required: true
        schema:
          type: integer
    get:
      operationId: getEmployeeBeneficiary
      parameters:
        - name: maskSsn
          in: query
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Beneficiary'
                  - $ref: '#/components/schemas/IndividualBeneficiary'
                  - $ref: '#/components/schemas/TrustBeneficiary'
                  - $ref: '#/components/schemas/CharityBeneficiary'
        '403':
          description: |
            - forbidden: cannot unmask
        '404':
          description: |
            - notFound: beneficiary not found
    put:
      operationId: updateEmployeeBeneficiary
      requestBody:
        $ref: '#/components/requestBodies/Beneficiary'
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
        '403':
          description: |
            - prerequisiteFailed: beneficiary cannot be updated (e.g. is ESTATE)
    delete:
      operationId: deleteEmployeeBeneficiary
      responses:
        '204':
          description: deleted
        '403':
          description: |
            - prerequisiteFailed: beneficiary cannot be deleted (e.g. is ESTATE)
  '/employees/{employeeId}/qualifyingEvents':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeQualifyingEvents
      parameters:
        - $ref: '#/components/parameters/expandQualifyingEvent'
      responses:
        '200':
          description: found employee qualifying events
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EmployeeQualifyingEvent'
    post:
      operationId: createEmployeeQualifyingEvent
      requestBody:
        $ref: '#/components/requestBodies/EmployeeQualifyingEvent'
      responses:
        '201':
          description: created employee qualifying event
          headers:
            Location:
              description: The location of the newly created employee qualifying event
              schema:
                type: string
              example: /employees/1/qualifyingEvents/1
        '400':
          description: |
            - badParameter: validation errors
        '409':
          $ref: 'shared.yaml#/components/responses/Duplicate'
  '/employees/{employeeId}/qualifyingEvents/{qualifyingEventId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/qualifyingEventId'
    get:
      operationId: getEmployeeQualifyingEvent
      parameters:
        - $ref: '#/components/parameters/expandQualifyingEvent'
      responses:
        '200':
          description: employee qualifying event found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmployeeQualifyingEvent'
        '404':
          description: |
            - notFound: employee qualifying event not found
    put:
      operationId: updateEmployeeQualifyingEvent
      requestBody:
        $ref: '#/components/requestBodies/EmployeeQualifyingEvent'
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
    delete:
      operationId: deleteEmployeeQualifyingEvent
      responses:
        '204':
          description: employee qualifying event deleted
  '/employees/{employeeId}/qualifyingEvents/{qualifyingEventId}/enrollments':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/qualifyingEventId'
    get:
      operationId: getQLEEnrollments
      parameters:
        - $ref: 'enrollment.yaml#/components/parameters/expand'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: 'enrollment.yaml#/components/schemas/Enrollment'
                    - $ref: 'enrollment.yaml#/components/schemas/PendingEnrollment'
  '/employees/{employeeId}/notes':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeNotes
      parameters:
        - $ref: '#/components/parameters/expandNote'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Note'
    post:
      operationId: createEmployeeNote
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '201':
          description: created
        '400':
          description: |
            - badParameter: validation errors
  '/employees/{employeeId}/notes/{noteId}':
    parameters:
      - $ref: 'shared.yaml#/components/parameters/accountHeader'
      - $ref: '#/components/parameters/employeeId'
      - name: noteId
        in: path
        required: true
        schema:
          type: integer
    get:
      operationId: getEmployeeNote
      parameters:
        - $ref: '#/components/parameters/expandNote'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Note'
        '404':
          description: |
            - notFound: not found
    put:
      operationId: updateEmployeeNote
      requestBody:
        $ref: '#/components/requestBodies/Note'
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
    delete:
      operationId: deleteEmployeeNote
      responses:
        '204':
          description: deleted
  '/employees/{employeeId}/qualifierTypes':
    parameters:
      - $ref: '#/components/parameters/employeeId'
    get:
      operationId: getEmployeeQualifierTypes
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                description: this will result in a map of qualifier type id (as a string) to an array of Qualifier resources
                type: object
                additionalProperties:
                  type: array
                  items:
                    $ref: '#/components/schemas/Qualifier'
  '/employees/{employeeId}/qualifierTypes/{qualifierTypeId}':
    parameters:
      - $ref: '#/components/parameters/employeeId'
      - $ref: '#/components/parameters/qualifierTypeId'
    get:
      operationId: getEmployeeQualifierType
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Qualifier'
    post:
      operationId: saveEmployeeQualifier
      requestBody:
        $ref: '#/components/requestBodies/Qualifier'
      responses:
        '204':
          description: Successful update
        '400':
          description: |
            - badParameter: validation errors
  /employees/identifierTypes:
    get:
      operationId: getEmployeeIdentifierTypes
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/IdentifierType'
  '/employees/identifierTypes/{identifierTypeId}':
    get:
      operationId: getEmployeeIdentifierType
      parameters:
        - $ref: '#/components/parameters/identifierTypeId'
      responses:
        '200':
          description: found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/IdentifierType'
        '404':
          description: |
            - notFound: identifier type not found
components:
  parameters:
    fullProfile:
      name: fullProfile
      description: show the profile (for employee and dependent) and workInformation (employee) in the employee and dependent resources
      in: query
      schema:
        type: boolean
        default: false
    employeeId:
      name: employeeId
      in: path
      required: true
      schema:
        type: integer
    dependentId:
      name: dependentId
      in: path
      required: true
      schema:
        type: integer
    contactType:
      name: contactType
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/ContactType'
    masked:
      name: masked
      description: whether sensitive information should be masked or not
      in: query
      schema:
        type: boolean
        default: true
    expandNote:
      name: expand
      in: query
      schema:
        description: allowed values are [createAdminId,uploadAdmin,documentIds]
        type: string
    expandQualifyingEvent:
      name: expand
      in: query
      schema:
        description: allowed values are [typeId,documentId]
        type: string
    expandDependentVerificationStatus:
      name: expand
      in: query
      schema:
        description: allowed values are [documentIds]
        type: string
    identifierTypeId:
      name: identifierTypeId
      in: path
      required: true
      schema:
        type: integer
    qualifierTypeId:
      name: qualifierTypeId
      in: path
      required: true
      schema:
        type: integer
    qualifyingEventId:
      name: qualifyingEventId
      in: path
      required: true
      schema:
        type: integer
    auditStartDate:
      name: auditStartDate
      in: query
      schema:
        type: string
        format: date
    auditEndDate:
      name: auditEndDate
      in: query
      required: true
      schema:
        type: string
        format: date
    changeType:
      name: changeType
      description: if not provided, then it defaults to all
      in: query
      schema:
        $ref: '#/components/schemas/ChangeType'
    overrideDuplicate:
      name: overrideDuplicate
      in: query
      schema:
        type: boolean
        default: false
  requestBodies:
    Employee:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Employee'
    EmployeeContact:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EmployeeContact'
    Salary:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Salary'
    Dependent:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Dependent'
    EmployeeClass:
      required: true
      description: note that the id for the class is required as the path is specifying the type id
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EmployeeClass'
    Beneficiary:
      required: true
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/Beneficiary'
              - $ref: '#/components/schemas/IndividualBeneficiary'
              - $ref: '#/components/schemas/TrustBeneficiary'
              - $ref: '#/components/schemas/CharityBeneficiary'
    EmployeeQualifyingEvent:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EmployeeQualifyingEvent'
    Note:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Note'
    Qualifier:
      required: true
      description: note that the id for the qualifier is required as the path is specifying the type id
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Qualifier'
  schemas:
    Employee:
      required:
        - name
        - birthDate
        - gender
      properties:
        id:
          type: integer
          readOnly: true
        name:
          $ref: 'shared.yaml#/components/schemas/Name'
        birthDate:
          type: string
          format: date
        gender:
          $ref: 'static.yaml#/components/schemas/Gender'
        profile:
          $ref: '#/components/schemas/Profile'
        workInformation:
          $ref: '#/components/schemas/WorkInformation'
        ssn:
          type: string
          deprecated: true
        hireDate:
          type: string
          format: date
          deprecated: true
        employeeId:
          type: string
          deprecated: true
        organizationId:
          type: integer
          deprecated: true
    Profile:
      properties:
        birthState:
          type: string
          maxLength: 2
        height:
          description: height in inches
          type: number
          format: float
        weight:
          description: weight in pounds
          type: integer
        ethnicity:
          type: string
        maritalSatus:
          type: string
        citizenship:
          type: string
        driversLicenseNumber:
          type: string
        driversLicenseState:
          type: string
          maxLength: 2
        languagePreference:
          $ref: 'static.yaml#/components/schemas/Vocabulary'
        tobaccoStatus:
          $ref: '#/components/schemas/TobaccoStatus'
        medicareEligibility:
          type: boolean
        dependentOrder:
          type: string
    TobaccoStatus:
      type: string
      enum: [TOBACCO,NONTOBACCO,UNDEFINED]
    WorkInformation:
      properties:
        occupation:
          type: string
        occupationDescription:
          type: string
        hireDate:
          type: string
          format: date
        organizationId:
          type: integer
        payrollFrequencyId:
          type: integer
        termination:
          $ref: '#/components/schemas/Termination'
    Termination:
      properties:
        terminationCodeId:
          type: integer
        terminationDate:
          type: string
          format: date
        terminationComments:
          type: string
          format: date
    EmployeeContact:
      allOf:
        - $ref: 'shared.yaml#/components/schemas/UserContact'
        - $ref: '#/components/schemas/ContactPreferences'
    ContactPreferences:
      properties:
        immediateContactPreference:
          type: string
          enum: [PHONE,EMAIL]
        contactTimeOfDay:
          type: string
          enum: [MORNING,AFTERNOON,EVENING]
        correspondenceType:
          type: string
          enum: [ELECTRONIC,PAPER]
        correspondenceLocation:
          $ref: '#/components/schemas/ContactType'
    ContactType:
      type: string
      enum: [HOME,WORK]
    Salary:
      required: [type,validity]
      description: |
        one of either annualSalary or hourlyWage plus hoursPerYear is required
        only one of each type can be valid at a single point in time
      properties:
        id:
          type: integer
          readOnly: true
        type:
          description: cannot change once created (i.e. an update will fail if different from previous type)
          type: string
          enum:
            - ANNUAL
            - BENEFIT
        annualSalary:
          description: type set to string to allow for masked values
          type: string
        hoursPerYear:
          type: number
          format: double
        hourlyWage:
          description: type set to string to allow for masked values
          type: string
        validity:
          $ref: 'shared.yaml#/components/schemas/Validity'
    Dependent:
      required:
        - name
        - birthDate
        - gender
      properties:
        id:
          type: integer
          readOnly: true
        name:
          $ref: 'shared.yaml#/components/schemas/Name'
        birthDate:
          type: string
          format: date
        gender:
          $ref: 'static.yaml#/components/schemas/Gender'
        dependentRelationsId:
          type: integer
        profile:
          $ref: '#/components/schemas/DependentProfile'
        ssn:
          type: string
          deprecated: true
        verificationStatus:
          allOf:
            - $ref: '#/components/schemas/VerificationStatus'
            - readOnly: true
    DependentProfile:
      allOf:
        - $ref: '#/components/schemas/Profile'
        - properties:
            disabled:
              type: boolean
              default: false
            handicapped:
              type: boolean
              default: false
            hiddenFromEmployee:
              type: boolean
              default: false
            verified:
              type: string
              enum: [VERIFIED,UNVERIFIED,REJECTED]
              default: UNVERIFIED
            ineligibleForCoverage:
              type: boolean
              default: false
            courtOrdered:
              type: boolean
              default: false
            student:
              type: boolean
              default: false
            school:
              type: string
    DependentVerificationStatus:
      description: Either documentIds or documents is available, not both, based on the expand attribute
      properties:
        verificationStatus:
          $ref: '#/components/schemas/VerificationStatus'
        documentIds:
          type: array
          items:
            type: integer
        documents:
          type: array
          items:
            $ref: 'document.yaml#/components/schemas/Document'
    VerificationStatus:
      type: string
      enum: [UNSPECIFIED,MEMBER_VERIFIED,MEMBER_REJECTED,ADMIN_VERIFIED,ADMIN_REJECTED]
    Beneficiary:
      required:
        - type
      properties:
        id:
          type: integer
          readOnly: true
        type:
          description: |
            cannot change once created (i.e. an update will fail if different from previous type)
            a beneficiary of type ESTATE cannot be created, updated, or deleted
          type: string
          enum: [INDIVIDUAL,ESTATE,TRUST,CHARITY]
        details:
          type: string
        contact:
          $ref: 'shared.yaml#/components/schemas/Contact'
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/BeneficiaryAllocation'
          readOnly: true
      discriminator:
        propertyName: type
        mapping:
          'INDIVIDUAL': '#/components/schemas/IndividualBeneficiary'
          'ESTATE': '#/components/schemas/Beneficiary'
          'TRUST': '#/components/schemas/TrustBeneficiary'
          'CHARITY': '#/components/schemas/CharityBeneficiary'
    IndividualBeneficiary:
      allOf:
        - $ref: '#/components/schemas/Beneficiary'
        - required:
            - relationshipToEmployee
          properties:
            dependentId:
              description: note that when saving, if this is set, the other fields will be ignored
              type: integer
            name:
              $ref: 'shared.yaml#/components/schemas/Name'
            relationshipToEmployee:
              type: string
            gender:
              $ref: 'static.yaml#/components/schemas/Gender'
            birthDate:
              type: string
              format: date
            ssn:
              type: string
    TrustBeneficiary:
      allOf:
        - $ref: '#/components/schemas/Beneficiary'
        - required:
            - name
            - trustAgreementDate
          properties:
            name:
              type: string
            trustee:
              $ref: 'shared.yaml#/components/schemas/Name'
            trustAgreementDate:
              type: string
              format: date
    CharityBeneficiary:
      allOf:
        - $ref: '#/components/schemas/Beneficiary'
        - required:
            - name
          properties:
            name:
              type: string
            taxId:
              type: string
    BeneficiaryAllocation:
      properties:
        product:
          type: string
        percent:
          type: number
          format: float
        type:
          $ref: '#/components/schemas/BeneficiaryAllocationType'
    BeneficiaryAllocationType:
      type: string
      enum: [PRIMARY,SECONDARY,CONTINGENT]
    IdentifierType:
      properties:
        id:
          type: integer
        type:
          type: string
          enum: [SSN,MEMBER,CUSTOM,EMPLOYEE_ID,CIF_NUMBER]
        name:
          description: this is the display name
          type: string
        validationRegex:
          type: string
        employeeEligible:
          type: boolean
        dependentEligible:
          type: boolean
    EmployeeClass:
      required:
        - validity
      properties:
        id:
          description: required for the update, ignored for the create
          type: integer
        name:
          description: this should be the class name (not the class type name)
          type: string
          readOnly: true
        validity:
          $ref: 'shared.yaml#/components/schemas/Validity'
    EmployeeRegion:
      properties:
        id:
          type: integer
        name:
          type: string
        validity:
          $ref: 'shared.yaml#/components/schemas/Validity'
    EmployeeQualifyingEvent:
      description: 
        Either typeId or type is available and either documentIds or documents is available, not both, based on the 
        expand attribute
      properties:
        id:
          type: integer
          readOnly: true
        typeId:
          type: integer
        type:
          $ref: 'account.yaml#/components/schemas/QualifyingEventType'
        eventDate:
          type: string
          format: date
        enrollmentValidity:
          $ref: 'shared.yaml#/components/schemas/Validity'
        createDate:
          type: string
          format: date
        employeeComment:
          description: this can only be added/updated by a employee
          type: string
        adminComment:
          description: this can only be added/updated by an admin or producer
          type: string
        status:
          type: string
          enum: [PENDING,APPROVED,DENIED]
        documentIds:
          type: array
          items:
            type: integer
        documents:
          type: array
          items:
            $ref: 'document.yaml#/components/schemas/Document'
    Note:
      description: 
        Either createAdminId or createAdmin is available and either documentIds or documents is available, not both, 
        based on the expand attribute
      properties:
        id:
          type: integer
          readOnly: true
        text:
          type: string
        createDate:
          type: string
          format: datetime
          readOnly: true
        createAdminId:
          type: integer
          readOnly: true
        createAdmin:
          $ref: 'account.yaml#/components/schemas/AccountAdmin'
        updateDate:
          type: string
          format: datetime
          readOnly: true
        updateAdminId:
          type: integer
          readOnly: true
        updateAdmin:
          $ref: 'account.yaml#/components/schemas/AccountAdmin'
        documentIds:
          type: array
          items:
            type: integer
        documents:
          type: array
          items:
            $ref: 'document.yaml#/components/schemas/Document'
    Qualifier:
      required:
        - qualifierTypeId
        - value
        - validity
      properties:
        id:
          type: integer
        value:
          type: string
        validity:
          $ref: 'shared.yaml#/components/schemas/Validity'
    SessionActivity:
      properties:
        cause:
          type: string
        on:
          type: string
          format: datetime
        actions:
          type: array
          items:
            $ref: '#/components/schemas/SessionActivityAction'
    SessionActivityAction:
      properties:
        name:
          type: string
        on:
          type: string
          format: datetime
    DemographicChange:
      properties:
        field:
          type: string
        on:
          type: string
          format: datetime
        changeType:
          $ref: '#/components/schemas/ChangeType'
        oldValue:
          type: string
        newValue:
          type: string        
    ChangeType:
      type: string
      enum: [PERSONAL,WORK,CONTACT]
    PaymentMethod:
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
        paymentType:
          type: string
          enum: [BANK_DRAFT,CREDIT_CARD,DEBIT_CARD]
        billingAdress:
          $ref: 'shared.yaml#/components/schemas/Address'
        sameAddressAsHome:
          type: boolean
      discriminator:
        propertyName: paymentType
        mapping:
          BANK_DRAFT: '#/components/schemas/BankDraftPaymentMethod'
          CREDIT_CARD: '#/components/schemas/CardPaymentMethod'
          DEBIT_CARD: '#/components/schemas/CardPaymentMethod'
    BankDraftPaymentMethod:
      allOf:
        - $ref: '#/components/schemas/PaymentMethod'
        - properties:
            bankName:
              type: string
            accountType:
              type: string
              enum: [CHECKING,SAVINGS]
            accountNumber:
              type: string
            routingNumber: 
              type: string
    CardPaymentMethod:
      allOf:
        - $ref: '#/components/schemas/PaymentMethod'
        - properties:
            token:
              type: string
            lastFour:
              type: string
              minLength: 4
              maxLength: 4
            expirationMonth:
              type: integer
              minimum: 1
              maximum: 12
            expirationYear:
              type: integer             
  securitySchemes:
    session:
      type: apiKey
      in: cookie
      name: SESSIONID

shared.yaml

openapi: '3.0.1'
info:
  version: '0.1'
  title: Shared Components
  description: |
    Due to the restrictions of current programs, instead of this being a standard YAML file, this must be a valid OAS
    file. As such, an empty paths object is included. This normally means that there are paths that exist here and are
    not available to be used, but in this case, no paths exist.
paths: {}
components:
  parameters:
    accountHeader:
      name: MP-Account
      in: header
      description: the identifier of the account in which the operation should be performed
      required: true
      schema:
        type: integer
    optionalAccountHeader:
      name: MP-Account
      in: header
      description: the identifier of the account in which the operation should be performed
      required: false
      schema:
        type: integer
    referenceDate:
      name: date
      in: query
      description: |
        the date at which the operation should be considered
        if no value is provided, assume the date to be TODAY
      required: false
      schema:
        type: string
        format: date
    searchProperty:
      name: property
      in: query
      description: the property on which to perform a search
      required: true
      schema:
        type: string
    searchValue:
      name: value
      in: query
      description: |
        the value of the property on which to perform a search
        note that this should be able to include a comma-separated list of values
      required: true
      schema:
        type: string
    optionalSearchProperty:
      name: property
      in: query
      description: the optional property on which to perform a search
      required: false
      schema:
        type: string
    optionalSearchValue:
      name: value
      in: query
      description: |
        the value of the optional property on which to perform a search
        note that this should be able to include a comma-separated list of values
      required: false
      schema:
        type: string
    sort:
      name: sort
      in: query
      description: the property and direction on which to sort
      schema:
        type: string
      example: name,desc
    page:
      name: page
      in: query
      description: the page of results to receive
      schema:
        type: string
    size:
      name: size
      in: query
      description: the size of the result set
      schema:
        type: string
  responses:
    Duplicate:
      description: |
        - duplicate: duplicate found
      headers:
        Location:
          description: the location of the duplicate
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Name:
      required:
        - firstName
        - lastName
      properties:
        firstName:
          type: string
        middleName:
          type: string
        lastName:
          type: string
        suffix:
          type: string
        maidenName:
          type: string
        nickname:
          type: string
    Contact:
      required:
        - address
      properties:
        address:
          $ref: '#/components/schemas/Address'
        phoneNumbers:
          type: array
          items:
            $ref: '#/components/schemas/PhoneContact'
        emailAddresses:
          type: array
          items:
            $ref: '#/components/schemas/EmailContact'
        phoneNumber:
          type: string
          pattern: '^\d{3}-?\d{3}-?\d{4}$'
          deprecated: true
        cellPhoneNumber:
          type: string
          pattern: '^\d{3}-?\d{3}-?\d{4}$'
          deprecated: true
        email:
          type: string
          deprecated: true
    UserContact:
      required:
        - address
      properties:
        address:
          $ref: '#/components/schemas/Address'
        phoneNumbers:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/PhoneContact'
              - $ref: '#/components/schemas/UserContactParameters'
        emailAddresses:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/EmailContact'
              - $ref: '#/components/schemas/UserContactParameters'
        phoneNumber:
          type: string
          pattern: '^\d{3}-?\d{3}-?\d{4}$'
          deprecated: true
        cellPhoneNumber:
          type: string
          pattern: '^\d{3}-?\d{3}-?\d{4}$'
          deprecated: true
        email:
          type: string
          deprecated: true
    PhoneContact:
      properties:
        phoneNumber:
          type: string
          pattern: '^\d{3}-?\d{3}-?\d{4}$'
        extension:
          type: string
        type:
          description: one of /static/phoneNumberTypes
          type: string
    EmailContact:
      properties:
        email:
          type: string
        type:
          description: one of /static/emailTypes
          type: string
    UserContactParameters:
      properties:
        verified:
          type: boolean
          readOnly: true
        primary:
          type: boolean
          default: false
    Address:
      required:
        - state
        - zip
      properties:
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        state:
          type: string
          maxLength: 2
        zip:
          type: string
          pattern: '^\d{5}?(-\d{4})?$'
        countyId:
          type: integer
        country:
          description: one of /static/countries
          type: string
    Validity:
      required:
        - effectiveStarting
      properties:
        effectiveStarting:
          type: string
          format: date
        expiresAfter:
          description: must be after effectiveStarting
          type: string
          format: date
    Error:
      properties:
        status:
          type: integer
        code:
          type: string
        message:
          type: string
          description: not included in QA or higher environments
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
    ErrorDetail:
      properties:
        objectId:
          description: Included in case the error refers to a list of objects. Otherwise null.
          type: integer
        field:
          type: string
        message:
          type: string
          description: not included in QA or higher environments
Command line used for generation

openapi-generator validate -i member.yaml

Steps to reproduce

Just run the command above against member.yaml. The shared.yaml file must be in the same directory as member.yaml.

Error being thrown
Errors:
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/identifiers/{identifierTypeId}'. Declared path parameter dependentId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/identifierTypes/{identifierTypeId}'. Declared path parameter identifierTypeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/qualifyingEvents/{qualifyingEventId}'. Declared path parameter qualifyingEventId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/verificationStatus'. Declared path parameter dependentId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/beneficiaries/{beneficiaryId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}'. Declared path parameter dependentId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/qualifierTypes'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/beneficiaries'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/qualifierTypes/{qualifierTypeId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/audit/enrollments'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/contacts/{contactType}'. Declared path parameter contactType needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/contact'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/qualifierTypes'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/contacts/{contactType}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/identifiers'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/notes/{noteId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/approveOrRejectVerification'. Declared path parameter dependentId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/paymentMethods'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/salaries'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/contact'. Declared path parameter dependentId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/identifiers/{identifierTypeId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/verificationStatus'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/qualifierTypes/{qualifierTypeId}'. Declared path parameter qualifierTypeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/approveOrRejectVerification'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/identifiers'. Declared path parameter dependentId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/classTypes/{classTypeId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/identifiers/{identifierTypeId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/qualifyingEvents/{qualifyingEventId}/enrollments'. Declared path parameter qualifyingEventId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/qualifierTypes'. Declared path parameter dependentId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/paymentMethods/{paymentMethodId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/contacts'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/identifiers/{identifierTypeId}'. Declared path parameter identifierTypeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/paymentMethods/{paymentMethodId}'. Declared path parameter paymentMethodId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/identifiers/{identifierTypeId}'. Declared path parameter identifierTypeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/qualifyingEvents/{qualifyingEventId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/regionTypes'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/qualifierTypes/{qualifierTypeId}'. Declared path parameter dependentId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/notes'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/qualifierTypes/{qualifierTypeId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/qualifyingEvents/{qualifyingEventId}/enrollments'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/classTypes'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/dependents/{dependentId}/qualifierTypes/{qualifierTypeId}'. Declared path parameter qualifierTypeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/qualifyingEvents'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/regionTypes/{regionTypeId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/identifiers'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/salaries/{salaryId}'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/audit/demographics'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
    -attribute paths.'/employees/{employeeId}/audit/sessionActivities'. Declared path parameter employeeId needs to be defined as a path parameter in path or operation level
auto-labeler[bot] commented 5 years ago

👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

rolandbaettig commented 5 years ago

same here with the following spec:

swagger: '2.0'

schemes:
- http

# Path API Definitions
paths:

  /document/upload/{documentId}:
    post:
      tags:
        - document
      summary: 'uploads a pdf as a document'
      consumes:
        - multipart/form-data
      parameters:
        - in: formData
          name: file
          type: file
          description: 'The file to upload.'
        - $ref: '#/parameters/documentid'
        - $ref: '#/parameters/language'
      responses:
        200:
          description: 'Successful operation'
        405:
          description: 'Invalid input'

parameters:

  documentid:
    name: documentId
    in: path
    description: 'id of the document'
    required: true
    type: integer

  language:
    name: language
    in: query
    description: 'required language'
    required: true
    type: string

results in the following error

[ERROR] 
org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 4, Warning count: 0
Errors: 
    -attribute paths.'/document/upload/{documentId}'. Declared path parameter documentId needs to be defined as a path parameter in path or operation level
macjohnny commented 5 years ago

this happens for any generator, e.g. spring

java -jar .\openapi-generator-cli.jar generate -g spring -i test.yml -o blub

with

swagger: '2.0'
info:
    description: >-
        This is the REST API
    version: 1.0.0
    title: test
schemes:
- http

# Path API Definitions
paths:

  /document/upload/{documentId}:
    post:
      tags:
        - document
      summary: 'uploads a pdf as a document'
      consumes:
        - application/json
      parameters:
        - $ref: '#/parameters/documentid'
        - $ref: '#/parameters/language'
      responses:
        200:
          description: 'Successful operation'
        405:
          description: 'Invalid input'

parameters:

  documentid:
    name: documentId
    in: path
    description: 'id of the document'
    required: true
    type: integer

  language:
    name: language
    in: query
    description: 'required language'
    required: true
    type: string

results in

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 1, Warning count: 0
Errors:
        -attribute paths.'/document/upload/{documentId}'. Declared path parameter documentId needs to be defined as a path parameter in path or operation level

        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:566)
        at org.openapitools.codegen.cmd.Generate.run(Generate.java:353)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:61)

@wing328 @jmini could you please have a look at this? this sounds like a serious issue and should definitely be resolved before the 4.0.0 release

macjohnny commented 5 years ago

it is all about referencing the path parameter

this works

swagger: '2.0'
info:
  version: 1.0.0
  title: OpenAPI Petstore

host: http://localhost
schemes:
  - http
paths:
  '/pet/{petId}':
    get:
      tags:
        - pet
      produces:
        - application/json
      parameters:
        - name: petId
          in: path
          required: true
          type: integer
      responses:
        '200':
          description: successful operation

parameters: 
    petId:
    name: petId
    in: path
    required: true
    type: integer

while this doesn't:

swagger: '2.0'
info:
  version: 1.0.0
  title: OpenAPI Petstore

host: http://localhost
schemes:
  - http
paths:
  '/pet/{petId}':
    get:
      tags:
        - pet
      produces:
        - application/json
      parameters:
        - $ref: '#/parameters/petId'
      responses:
        '200':
          description: successful operation

parameters: 
    petId:
    name: petId
    in: path
    required: true
    type: integer
wing328 commented 5 years ago

@GetDaStick @rolandbaettig @macjohnny have you guys tried the following suggestion?

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).

The issue is due to a limitation in the swagger parser not being able to handle the parameter reference correctly.

rolandbaettig commented 5 years ago

Yes and we tried but it had no impact the error came anyway

Am 16.02.2019 um 14:03 schrieb William Cheng notifications@github.com:

@GetDaStick @rolandbaettig @macjohnny have you guys tried the following suggestion?

Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).

The issue is due to a limitation in the swagger parser not being able to handle the parameter reference correctly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

wing328 commented 5 years ago

@rolandbaettig is it correct to say that you were able to generate the code successfully and you're looking for a way to hide/disable/fix the incorrect error message (false alarm)?

JoBrad commented 5 years ago

I also get this error. I would prefer to get valid spec errors, although passing the option to skip spec validation does work around this issue. Thanks!

rolandbaettig commented 5 years ago

No it is not. I couldn’t generate the code with the reference to the path parameter. I had to replace the reference with the definition of the path param.

Von: William Cheng notifications@github.com Antworten an: OpenAPITools/openapi-generator reply@reply.github.com Datum: Sonntag, 17. Februar 2019 um 02:53 An: OpenAPITools/openapi-generator openapi-generator@noreply.github.com Cc: Roland Bättig conil@bluewin.ch, Mention mention@noreply.github.com Betreff: Re: [OpenAPITools/openapi-generator] [BUG][typescript-angular] Attribute path error while using #ref for path parameters (#2150)

@rolandbaettig is it correct to say that you were able to generate the code successfully and you're looking for a way to fix the incorrect error message (false alarm)?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

anibalcesar commented 5 years ago

We are having the same issue.

wing328 commented 5 years ago

@anibalcesar have you tried --skip-validate-spec to skip the validation?

cognifloyd commented 5 years ago

Can someone change the title of this? This is a general issue, so [typescript-angular] should be removed. Disabling validation is not really an option in my team. :( But it looks like the fix to silence the false positive is in the pipe :)

I looked into swagger-parser and it looks like this false alarm is fixed in swagger-api/swagger-parser@56c9830 which is in v2.0.9. Currently, openapi-generator master is using a fork based on 2.0.8: https://github.com/OpenAPITools/openapi-generator/blob/d32564da51c2dd18c2acc61473e44589a13a89f7/pom.xml#L1365-L1366

All commits from swagger-paraser v2.0.9 are included in the OpenAPITools branch/fork: https://github.com/OpenAPITools/swagger-parser/compare/2.0-OpenAPITools...swagger-api:v2.0.9 And it looks like that will be released as 2.0.10-OpenAPITools.org-1 to be included with openapi-generator in #2262. (Thanks for the pointer about the PR to update the dep in gitter @wing328)

So, I guess it is coming soon :)

wing328 commented 5 years ago

Disabling validation is not really an option in my team. :

Do you mind elaborating on this? We're thinking about showing the validation error as warnings moving forward (so --skip-validate-spec set to true be default)

cognifloyd commented 5 years ago

When someone introduces something that breaks the spec, it should fail as loudly as possible and prevent them from continuing without fixing the spec. It's an effort to increase code quality. Though, I suppose once it hits the generator, that is probably too late in the process, and they should have those errors much sooner. Hmm. I guess turning those errors into warnings at the generator stage wouldn't be that bad.

wing328 commented 5 years ago

I totally agree with detecting broken specs as part of the workflow but at the same time I think we should evaluate whether openapi-generator is the ideal candidate for validating the spec as the validation relies on swagger parser (which is a dependency we do not actively work on). Personally, I always use https://github.com/APIDevTools/swagger-cli to validate the spec (this is not to say the spec validation feature in openapi-generator is bad or unusable).

The reason why I brought this up is that the false alarm seems to be causing quite a lot of confusions, which introduces unnecessary overhead in support.

We can try the latest swagger parser to see if the false alarms go away before deciding what to do next.

wing328 commented 5 years ago

Please try the latest master with the upgrade parser to see if it's still an issue.