2016-04-06 6 views
1

Мне сложно определить, почему следующий raml не загружается при попытке создать новый проект:Anypoint Studio не может загружать raml для APIKit, но он также говорит, что ничего не работает с файлом raml

#%RAML 0.8 
title: MyMuleAPI API 
version: v1 
baseUri: https://localhost/api/v1 
securitySchemes: 
    - oauth_2_0: 
     description: | 
      MyCompany supports OAuth 2.0 for authenticating all API requests. 
     type: OAuth 2.0 
     describedBy: 
      headers: 
       Authorization: 
        description: | 
         Used to send a valid OAuth 2 access token. Do not use 
         with the "access_token" query string parameter. 
        type: string 
      queryParameters: 
       access_token: 
        description: | 
         Used to send a valid OAuth 2 access token. Do not use together with 
         the "Authorization" header 
        type: string 
      responses: 
       401: 
        description: | 
         Bad or expired token. This can happen if the user or Dropbox 
         revoked or expired an access token. To fix, you should re- 
         authenticate the user. 
       403: 
        description: | 
         Bad OAuth request (wrong consumer key, bad nonce, expired 
         timestamp...). Unfortunately, re-authenticating the user won't help here. 
     settings: 
      authorizationUri: https://login-dev.mycompany.com/connect/authorize 
      accessTokenUri: https://login-dev.mycompany.com//connect/token 
      authorizationGrants: [ token ] 

schemas: 
- Address: | 
    { 
     "id": "Address", 
     "title": "Address", 
     "Description": "the object for passing around addrss information", 
     "properties": { 
     "street": { 
      "description": "street including street number and appartment unit#", 
      "type": "string" 
     }, 
     "street2": { 
      "description": "second line of the address.", 
      "type": "string" 
     }, 
     "city": { 
      "description": "city name", 
      "type": "string" 
     }, 
     "state": { 
      "description": "a valid 2-letter US state abbreviation", 
      "type": "string" 
     }, 
     "zip": { 
      "description": "a 5-digit zip code", 
      "type": "string" 
     }  
     } 
    } 
- LoanApplication: | 
    { 
     "id": "LoanApplicationData", 
     "title": "LoanApplicationData", 
     "description": "loan application.", 
     "type": "object", 
     "properties": { 
     "loan_id": { 
      "description": "the Loans identifier for the loan request", 
      "type": "string" 
     }, 
     "FirstName": { 
      "description": "Applicant's first name.", 
      "type": "string" 
     }, 
     "LastName": { 
      "description": "Applicant's last name.", 
      "type": "string" 
     }, 
     "Address": { 
      "description": "applicat's address", 
      "type": "object" 
     }, 
     "Email": { 
      "description": "Applicant's email.", 
      "type": "string" 
     }, 
     "Phone": { 
      "description": "Applicant's phone, optional.", 
      "type": "string" 
     }, 
     "SSN": { 
      "description": "Applicant's SSN.", 
      "type": "string" 
     }, 
     "DateOfBirth": { 
      "description": "Applicant's date of birth.", 
      "type": "string" 
     }, 
     "YearlyIncome": { 
      "description": "Applicant's income.", 
      "type": "number" 
     } 
     } 
    } 
- LoanResponse: | 
    { 
     "id": "LoanResponse", 
     "title": "LoanResponse", 
     "Description": "the basic response telling you the current status of the loan", 
     "properties":{ 
     "loan_id": { 
      "description": "the Loan id to track this loans progress", 
      "type": "string" 
     }, 
     "status": { 
      "description": "a string describing the curernt state the loan is currently in", 
      "type": "string" 
     }, 
     "status_id": { 
      "description": "a numberic version of the status text", 
      "type": "integer" 
     } 
     } 
    } 
/application: 
    securedBy: [oauth_2_0] 
    /{loan_id}: 
    securedBy: [oauth_2_0] 
    uriParameters: 
     loan_id: 
     description: loan applicationData ID. 
     type: string 
     required: true 
     displayName: loan_id 
    put: 
     body: 
     application/json: 
      schema: LoanApplication 
     displayName: Application_Put 
     description: "Updates loan applicationData. 

      TODO: what do we allow to update." 
     responses: 
     200: 
      description: OK 
      body: 
      application/json: 
       schema: LoanApplication 
    get: 
     displayName: Application_Get 
     description: "retrieves application details" 
     responses: 
     200: 
      description: successful request 
      body: 
      application/json: 
       schema: LoanApplication 

    post: 
    body: 
     application/json: 
     schema: LoanApplication 
    displayName: Application_Post 
    description: Creates loan applicationData. 
    responses: 
     200: 
     description: OK 
     body: 
      application/json: 
      schema: LoanApplication 

error I get when attempting to create the project

при попытке запустить проект с этой Raml к югу из АНИ, я получаю следующее: но когда я загружаю Raml либо дизайнера апи, или пнуть проверку AnyPoint, это говорит there are no problems

Что я упущу?

ответ

1

Если я открываю выше Raml в API Workbench, я получаю следующее предупреждение:

enter image description here

Если я переписать описание, как это:

put: 
    body: 
    application/json: 
     schema: LoanApplication 
    displayName: Application_Put 
    description: | 
    Updates loan applicationData. 

    TODO: what do we allow to update. 
    responses: 

то предупреждение уходит. Может быть, это решит вашу проблему?

+0

К сожалению, я по-прежнему получаю ту же ошибку. это супер странно –

+0

: '(что, если вы загрузите свой RAML с помощью одного из доступных парсеров? –

+0

Эта рампа отлично выглядит в инструментах apideveloper. Я в недоумении, почему это не удается в студии Anypoint. –

 Смежные вопросы

  • Нет связанных вопросов^_^