cancel
Showing results for 
Search instead for 
Did you mean: 

Structural error at paths

SOLVED
Occasional Contributor

Structural error at paths

 

basePath : "/services/apexrest/sg"
schemes:
- "https"
- "http"
paths:
  /0.1/customer:
    get:
      description: Should give an overview / a list of all customers with state active. List should contain ID and Name of customer.
      responses:
        200:
         description: Successfull
         schema:
               type: array
               items:
                properties:
                  id:
                   type: integer
                   example: 007
                  name:
                   type: string
                   example: Nishant
                  count:
                   type: integer
                   example: 04121988
      security:
      - subscription_auth:
        - "write:pets"
        - "read:pets"
        
  /0.1/customer/{account_id}:
    get:
      summary: Get a user by ID
      parameters:
        - in: path
          name: account_id
          type: integer
          required: true
          description: Numeric ID of the Account to get Account Details
      responses:
        200:
          description: Account Details
          schema:
                type: object
                properties:
                  name:
                   type: string
                   example: Nishant
                  site:
                   type: string
                   example: berlin
                  billingAddress:
                   type: string
                   example: berlin
                  description:
                   type: string
                   example: Account's details
                  phone:
                   type: integer
                   example: 02736464648494
                  shippingAddress:
                   type: string
                   example: berlin
                  website:
                   type : string
                   example : www.XXXX.com
                  childAccounts:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  createdBy:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  lastModifiedBy:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  parentAccount:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
      security:
      - subscription_auth:
        - "write:pets"
        - "read:pets"
  /0.1/customer/{account_id}/subscriptions:
    get:
      summary: Get a user's Subscription by ID
      parameters:
        - in: path
          name: account_id
          type: integer
          required: true
          description: Numeric ID of the Account to get
      responses:
        200:
          description: Account Details
          schema:
                type: object
                properties:
                  activeSubscriptions:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  countActiveSubscriptions:
                   type: integer
                  inActiveSubscriptions:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  countInActiveSubscriptions:
                   type: integer
                  canceledSubscriptions:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  countCanceledSubscriptions:
                   type: integer
                   example: 20000
      security:
      - subscription_auth:
        - "write:pets"
        - "read:pets"
  /0.1/subscription:
    get:
      description: Should give an overview / a list of all subscriptions with state active.
      responses:
        200:
         description: Successfull
         schema:
               type: array
               items:
                properties:
                  activeSubscriptions:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  countActiveSubscriptions:
                   type: integer
                   example: 04121988
      security:
      - subscription_auth:
        - "write:pets"
        - "read:pets"
  /0.1/subscription/{SUBSCRIPTION_ID}/:
    get:
      summary: Get a user's Subscription by ID
      parameters:
        - in: path
          name: SUBSCRIPTION_ID
          type: integer
          required: true
          description: Numeric ID of the Subscription to get
      responses:
        200:
          description: Subscription Details
          schema:
                type: object
                properties:
                  id:
                   type: string
                   example: 564664564Nishant
                  name:
                   type: string
                   example: Nishant
                  account:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  createdBy:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  currency:
                   type: integer
                   example: 02736464648494
                  initialMRR:
                   type: integer
                  lastInvoiceRun:
                   type : string
                  owner:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  nextInvoice:
                   type: string
                  lastModifiedBy:
                   type: object
                   items:
                     properties:
                       Id :
                        type : string
                       name :
                        type : string
                  quoteNumber:
                   type: string
                  renewalDate:
                   type: string
                  startDate:
                   type: string
                  status:
                   type: string
      security:
      - subscription_auth:
        - "write:pets"
        - "read:pets"
  /0.2/jobs/{JOB_ID}/:
    get:
      summary: Get a user's Service by Job_ID
      parameters:
        - in: path
          name: JOB_ID
          type: integer
          required: true
          description: Numeric ID of the Job to get details from the Service object
      responses:
        200:
          description: Job Details
          schema:
                type: object
                properties:
                  name:
                   type: string
                   example: Nishant
                  Price:
                   type: integer
                   example: 02736464648494
                  Channel:
                   type : string
                  Date:
                   type: string
      security:
      - subscription_auth:
        - "write:pets"
        - "read:pets"
                  
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      description: /services/oauth2/success
      flows: 
        clientCredentials: 
          tokenUrl: /oauth2/token
          scopes: 
            write: modify your account
            read: read your Account
securityDefinitions:
  subscription_auth:
    type: "oauth2"
    authorizationUrl: "http://--uat.lightning.force.com/oauth/dialog"
    flow: "implicit"
    scopes:
      write:pets: "modify subscription"
      read:pets: "read your record"
  api_key:
    type: "apiKey"
    name: "api_key"
    in: "header"

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: Structural error at paths

OK I see the error now. It's caused by an extra "securitySchemes" section in "paths". You need to remove it.

 

HKosova_0-1606838096338.png


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

7 REPLIES 7
Moderator

Re: Structural error at paths

Can you please format your YAML as code to preserve the original indentation? Otherwise it's hard to see where the error might be.

 

HKosova_0-1594914317648.png


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Occasional Contributor

Re: Structural error at paths

Thanks for getting back. i edited it for your kind reference.

Moderator

Re: Structural error at paths

If don't see any errors about paths, only errors about missing securityDefinitions.

 

HKosova_0-1606835950425.png

 

Is it possible that your original API definition uses a mix of tabs and spaces for indentation? This can cause strange errors like the one you're seeing. Try to indent everything using spaces and see if it helps.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Occasional Contributor

Re: Structural error at paths

you are checking it in open api 3.0, i am having this problem in swagger 2.0 version

Occasional Contributor

Re: Structural error at paths

i used only spaces for indentation but it does not help unfortunately 😞

Moderator

Re: Structural error at paths

OK I see the error now. It's caused by an extra "securitySchemes" section in "paths". You need to remove it.

 

HKosova_0-1606838096338.png


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

Occasional Contributor

Re: Structural error at paths

wow! you are awesome. Thanks 🙂 it worked finally. i am struggling for 2 days. Thanks a lot 🙂

New Here?
Join us and watch the welcome video:
Announcements