Code Monkey home page Code Monkey logo

api-designer's People

Contributors

agustinlg avatar alejofernandez avatar aminix avatar blai avatar blakeembrey avatar carowright avatar clarkcutler avatar comptly avatar dy93 avatar federicoboerr avatar gitter-badger avatar ivolazy avatar jcalabrese avatar jcenturion avatar jisoldi avatar juancoen avatar llattes avatar mariamare avatar mnbattaglia avatar nanovazquez avatar noambenami avatar noplanman avatar pennycoders avatar pose avatar rciccone91 avatar rodrigoi avatar sichvoge avatar tokafish avatar viceversus avatar xaka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-designer's Issues

formParameters: !include employee_upsert_schema.map causes error in RAML

I'm trying to use an include for formParameters like I do for the json schema. Since it wants a map I my include is:
formParameters: !include employee_upsert_schema.map

The file looks like this:

         first_name:
           description: Employee First Name
           type: string
           minLength: 2
           maxLength: 20
           required: true
           example: Joe
         last_name:
           description: Employee Last Name
           type: string
           minLength: 2
           maxLength: 20
           required: true
           example: Smith

But API Designer is telling me 'formalParameters' must be a map.

Question: "include" syntax

Is the following syntax supported for the localhost?
traits:

  • !include common/CommonTraits.yaml

The above does not seem to work (which used to work in earlier revisions). I had to use the following:

traits:

After making the above changes, I'm getting the following error,
"Cannot read property 'value' of undefined"

Also, I'm getting the following error,
Object # has no method 'match'

I've opened the JavaScript console in the browser and there does not seem to be any error or warning.

Please let me know if you need more information

-Mallesh

No API-Console available

Hi guys,

in your youtube video there is an api-console available on the right side. I cloned the repository and am running the local version of the API-Designer but unfortunately I don't see the console on the right side.

Cheers
Igor

API definitions with custom authentication methods cause a js error

Attempting to create a RAML spec with a custom authentication method will cause an ungraceful javascript error when testing:

For the RAML file:

#%RAML 0.8
title: Demonstration API
baseUri: https://test.com/api
securitySchemes:
    - homeRolledAuth:
        description: a custom authentication header implementation
        type: x-custom-header-protocol
        describedBy:
          headers:
            X-Request-Token:
              type: string
/auth-ping:
    description: A demonstration ping service that requires authentication
    get:
        securedBy: [homeRolledAuth]

Attempting to:

  • Click on "GET" for the /auth-ping endpoint
  • select the "HomeRolledAuth" authentication option
  • click "GET"

will result in the following javascript error:

TypeError: Cannot read property 'authenticate' of undefined
    at TryIt.execute (http://designer.apihub.com/scripts/vendor.js:65786:17)
    at http://designer.apihub.com/scripts/vendor.js:18597:21
    at http://designer.apihub.com/scripts/vendor.js:26785:17
    at Scope.$eval (http://designer.apihub.com/scripts/vendor.js:20459:28)
    at Scope.$apply (http://designer.apihub.com/scripts/vendor.js:20557:23)
    at HTMLButtonElement.<anonymous> (http://designer.apihub.com/scripts/vendor.js:26784:21)
    at HTMLButtonElement.f.event.dispatch (http://api-portal.anypoint.mulesoft.com/sites/api-portal.anypoint.mulesoft.com/files/js/js_0gj6QcpfRH2jzTbCQqf7kEkm4MXY0UA_sRhwPc8jC1o.js:3:4351)
    at HTMLButtonElement.h.handle.i (http://api-portal.anypoint.mulesoft.com/sites/api-portal.anypoint.mulesoft.com/files/js/js_0gj6QcpfRH2jzTbCQqf7kEkm4MXY0UA_sRhwPc8jC1o.js:3:335) vendor.js:17840

Obviously this feature can't be made to work entirely, since the custom authentication protocol is unknown to the application, but a more robust error state would be better.

API Designer: Quote at beginning of queryParameter Description causes error.

This queryParameter Description works:

        happy:
          description: Quotes within a description, 'like this', display correctly. However, if you go into the RAML and uncomment the _next_ queryParameter, whose description begins with a quote, API Designer throws the error **expected block end but found scalar**.
          example: 1
          required: false
          type: integer

This one causes the error expected block end but found scalar. It has a phrase enclosed in quotes; in fact, the second quote can be removed and you still get the error.

       not-so-happy:
          description: 'This throws an error' but it should not.
          example: 99
          required: false
          type: integer

Here's a screenshot and RAML and sample.

quotes-at-start-cause-error

foo.raml

#%RAML 0.8
baseUri: https://foo.example.com
title: Foo API
version: 0.2

resourceTypes:
  - collection:
      description: | 
        Collection of available <<resourcePathName>>. <br /> <br /> POST creates an <<resourcePathName|!singularize>>. GET shows an index. 
      get:
        description: Get a list of <<resourcePathName>>.
        headers: &commonHeaders
          funky-thang:
            displayName: Its-Your-Thing
            description: Do what you want to do. 
            example: "xyz987654"
          accept: 
            displayName: Accept
            description: MIME types that client is willing to accept.
            example: "*/*"
          content-type: 
            displayName: Content Type
            description: MIME type of document being served.
            example: "application/x-www-form-urlencoded,application/json"
        responses: &commonResponses
          200:
            body:
              application/json:
                example: |
                  <<exampleCollection>>
          404:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> not found" }
          422:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> cannot be processed because it has failed validation" }
          500:
            body:
              application/json:
                example: |
                  {"message": "internal server error" }
        is: [
          pageable
        ]
traits:
  - pageable:
      queryParameters:       
        happy:
          description: Quotes within a description, 'like this', display correctly. However, if you go into the RAML and uncomment the _next_ queryParameter, whose description begins with a quote, API Designer throws the error **expected block end but found scalar**.
          example: 1
          required: false
          type: integer
#        not-so-happy:
#          description: 'This throws an error' but it should not.
#          example: 99
#          required: false
#          type: integer
/things:
  description: |
    Many things, cabbages and kings.
  type:
    collection:
      exampleCollection: !include things.sample

things.sample

[{
  "artistId": "110e8300-e32b-41d4-a716-664400445500",
  "artistName": "Daft Punk",
  "description": "French electronic music duo consisting of musicians Guy-Manuel de Homem-Christo and Thomas Bangalter",
  "imageURL": "http://travelhymns.com/wp-content/uploads/2013/06/random-access-memories1.jpg"
  "nationality": {
    "countryCode": "FRA",
    "countryName": "France"
  }
},
{
  "artistId": "110e8300-e32b-41d4-a716-229932554400",
  "artistName": "Pink Floyd",
  "description": "English rock band that achieved international acclaim with their progressive and psychedelic music.",
  "imageURL": "http://www.billboard.com/files/styles/promo_650/public/stylus/1251869-pink-floyd-reunions-617-409.jpg",
  "nationality": {
    "countryCode": "ENG",
    "countryName": "England"
  }
},
{
  "artistId": "11032be3-41d4-4455-a716-664400a71600",
  "artistName": "Radiohead",
  "description": " English rock band from Abingdon, Oxfordshire, formed in 1985",
  "imageURL": "http://www.wired.com/images_blogs/photos/uncategorized/2007/10/01/radiohead.jpg",
  "nationality": {
    "countryCode": "ENG",
    "countryName": "England"
  }
},
]

After importing files the 'Add a new file' dialog opens again.

  1. I've cloned the current version and started the API Designer.
  2. 'Add a new file' ask me to create a new RAML file since the project is empty. Enter'api.raml' and click OK.
  3. Go to 'Import' and import ZIP with following files (api.raml, employee.json, employee_schema.json)
  4. Import done! Dialog for 'Add a new file' appears again saying there is no project file (see attachment)

screen shot 2014-10-31 at 10 43 00

Traits that respond with the same response code

It would be great if it would be possible to use two traits for one api end point. And to show that the end point can answer with either one of the two ways.

traits:
  - secured_key:
      responses:
        401:
          body:
  - secured_token:
      responses:
        401:
          body:
/keys:
  is: [ secured_key, secured_token ]

Basic Auth doesn't work due to missing `CryptoJS`

Any request with Basic Auth errors out because CryptoJS is not defined:

TypeError: Cannot read property 'authenticate' of undefined
    at TryIt.execute (http://localhost:9013/bower_components/api-console/dist/scripts/app.js:1632:17)
    at http://localhost:9013/bower_components/angular/angular.js:10821:21
    at http://localhost:9013/bower_components/angular/angular.js:19062:17
    at Scope.$eval (http://localhost:9013/bower_components/angular/angular.js:12658:28)
    at Scope.$apply (http://localhost:9013/bower_components/angular/angular.js:12756:23)
    at HTMLButtonElement.<anonymous> (http://localhost:9013/bower_components/angular/angular.js:19061:21)
    at http://localhost:9013/bower_components/angular/angular.js:2843:10
    at forEach (http://localhost:9013/bower_components/angular/angular.js:325:18)
    at HTMLButtonElement.eventHandler (http://localhost:9013/bower_components/angular/angular.js:2842:5) 

Screenshot here

Seems like an easy fix to get that dependency in there, but I'm just going to create a fork and merge req that just uses atob and btoa

Api designer caches the reuqest

Hi,
We found out that the api-designer caches a get request for remote includes.

#%RAML 0.8
title: my Products API
baseUri: http://localhost/
version: v1
mediaType:  application/json

schemas:

  - error: !include http://api.mycompany.com/patterns/v1/schema-error-message.json 

traits: 

  - !include http://api.mycompanys.com/patterns/v1/trait-languageModification-aware.yaml    


/products:
  type: collection

Once I have temporary unavailable resource at http://api.mycompanys.com/patterns/v1/trait-languageModification-aware.yaml I got the message similar to this

screen shot 2014-09-11 at 13 00 33

The api-designer does not recover even if the remote resource is available again.

Only solution is to artificially add some query param to remote resource

  - !include http://api.mycompanys.com/patterns/v1/trait-languageModification-aware.yaml?162627536723

to make the UI really fetch it again.

Blank screen on the browser

I had downloaded the designer a couple of months ago, and had it set up and running fine. I wanted to refresh the code to take advantage of the new shiny that you guys are doing, but the latest version that I pulled just brings up the browser with a blank screen. There's content behind it (lots of javascript tags) but nothing I can actually see. any thoughts?

Question - And a really dumb one...

Firstly, thanks for contributing this, i'm slowly coming up-to-speed with RAML and this is a good way to get there.

Now my dumb question, and i'm really embarrassed to ask this !.

I'm running a local instance of the tool that i cloned from GIT, it runs fine but for the life of me i can't find where the raml files are being written,; as i suspect i'll be writing markdown and json schema files as well i need the ability to author such items in other tools and master the coherent set of artifacts under SCM.

And in the interest of clarity i'm in no way a JS or Node expert ;-)

Thanks again

Jem...

Reversing order of page titles would make them more useful

If I have API Designer on one tab, Portal on another, API administration on another, etc, all I see on the tabs is Anypoint for the pages other than the one in front. I already know they're all Anypoint by virtue of the icon that appears before the word, which is long enough to take up all the visible space in the tab.

This is not very useful. In Chrome, I need to use the Window menu to see the full titles of these pages, which have multiple parts, for example:

 Anypoint Platform for APIs / API Administration / <API_name> / Designer 

Why not reverse the order?

 Designer / <API_name> / API Administration / Anypoint Platform for APIs

Then I would have the good user experience of seeing tabs for Designer, API Administration, API Reference, etc, and not have to bother with the Window menu to figure out where a particular tab is.

Cache RAML files

RAML files should be able to be cached and the cached state retrieved from memory through an !include. This would improve performance of parsing large sets of RAML files.

Font locking breaks when * appears in a resource's URI

I have a resource whose URI is something like:
/api/v1/widget/*/tags/{tag}
When I add it to my document in the api-designer, everything up to and including the * is white while things after the */ are red, as is usual for URI templates. However * is a legal character in a paths. See:
http://tools.ietf.org/html/rfc3986#section-3.3
I notice a few other "subdelims" confuse the api-designer as well: ~, $, =, etc.
I don't know if these characters will end up confusing other tools in the RAML tool chain, but the api-designer gives the impression that paths containing them are not legal.

CodeMirror is slow

Hello,

I have been working on some models (a few thousand of lines) for my customer (SNCF).

My models include very big json files (examples of request and response data).

I understand that CodeMirror is well suited for editing the raml files.

But It seems to me that CodeMirror is overkill for visualizing JSON files.

I replaced CodeMirror with a "simpler" editor (https://github.com/hrovira/jsoneditor)

The tool is now much much faster ...

Maybe you could keep on using CodeMirror for the RAML files and choose another editor for the other kind of files ?

Best regards,
Mehdi

Parse RAML dependency when background !include changes

When an !include'd file changes (drag and drop, import, etc.) we should reparse the current RAML document. This is an extension of the change introduced at #252, but requires a much larger overhaul to work - either making content changes a getter/emitter or being able to $watch all !include'd files. One performance restriction is that there's currently no way to list !include dependencies of files to trigger recursive updates of RAML correctly.

Singularize does not support dashes

In RAML .8 The Singularize Function for does not support dashes (-): <<resourcePathName|!singularize>>.

For instance I cannot singularize

/medical-authorizations

The result of the function call is "authorization" when the correct result should be "medical-authorization"

Default transformation of the response via HTTP kills the api design editor

Hi,

I took me quite some time to figure this out, so I thought it would be useful posting. I had been trying the original api designer implementation with the local browser storage and it worked very well for me. As I wanted to run this with a bit more persistence (also to think about versioning my changes) I put an HTTP/PHP/MySQL storage behind the editor. I defined my own FileSystem that would use the following method to load a file into the editor:

    service.load = function (path) {
      var deferred = $q.defer();
      $http({
        method: 'GET',
        url: 'files.php?path=' + encodeURIComponent(path),
        withCredentials: false,
      }).success(function (data, status, headers, config) {
        deferred.resolve(data);
      }).error(deferred.reject.bind(deferred));
      return deferred.promise;
    };

I was able to load .yaml and .raml files without any problems, but loading some of the JSON files that I use as body examples etc. wouldn't work. Also, the live preview started to fail when switching to the new file system. So I had a look into the code and figured that the $http call would automatically identify and transform a JSON string into an JS object which internally will not work as response data because the logic expects a string. This solution for me was to overload the automatic transformation by providing the "transformResponse" property like this:

    service.load = function (path) {
      var deferred = $q.defer();
      $http({
        method: 'GET',
        url: 'files.php?path=' + encodeURIComponent(path),
        withCredentials: false,
        **transformResponse: function(data) { return data; }**
      }).success(function (data, status, headers, config) {
        deferred.resolve(data);
      }).error(deferred.reject.bind(deferred));
      return deferred.promise;
    };

After that the editor would again load my JSON files and event the live preview started to work again. I have not yet figured whether this has any negative side effects, but will let you know. If there is a better workaround for this, let me know.

Tobias.

Getting started docs

Took me a while to get things going because of some missing and misleading steps in your docs at
https://github.com/mulesoft/api-designer/

Missing step:
install grunt protractor

npm install grunt-protractor-runner

erroneous step:
Install webdriver required to run localScenario task

node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update

Should be:
Install webdriver required to run localScenario task

node node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update

I had no idea that the last step here needed to be run by node.

Question - Remote file server support

Thanks for contributing to this. Looks very promising.
Are there any plans to support retrieving and saving an existing RAML file from/to a remote file server (over HTTP(S))?
I ask this as I see that there is remote-file-system.js which supports various operations to the remote file server.

-Mallesh

Any request to the real API results in a 404

We've captured the POST request coming from API-Designer with fiddler and realised that it was an OPTIONS request. Doesn't matter what request we define in our .raml document - the only request API-Designer is sending is the OPTIONS request.

Enable right click to create files/folders

It would be more intuitive that when you right click a folder, it gives you the option to create a directory inside the current file. This would also allow the "new file" button to add to root instead of the currently selected location.

Why was remote-file-system removed?

Is this some part of a larger plan for persisting schemas to somewhere other than local storage?

I'm looking for some context here as we're using it to save schemas to the local file system (via a quick'n'dirty node app)

Raml document decomposition

I'd like to decompose a large raml document, e.g. by top level resources. Everything works well but one thing. I can't tell editor, that the contents of some *.raml file is not a whole document but a single resource and I can start this file with http methods, but not title and version.
Is it possible?

With locally run Designer - unable to Export

When using Designer at anypoint, I am allowed to "Export Files".

When running it locally, I do not see any such option present.

Issue #95 explains, I can find the data in local storage in the browser, but having an option to export set of files into zip archive and import it into anypoint Designer makes testing of locally running services much easier.

ctrl+z with multiple files mixes files' content

Scenario:
Having 2 files in the designer (both saved) do this:

  • add something to the file A.

  • save file A.

  • go to file B.

  • press ctrl+z.

    -> You will get the data of the file A overriding file B, and losing the data in file B.

Ability to view binary assets

Kind of like Sublime Text implemented, it'd be cool to be able to view images, music and videos in the editor as assets instead of text.

Getting and passing Authorisation Token into a header

Hi,

My API requires that I first get an auth token by calling an auth method within the API. This returns a token e.g. 1035837f-f452-c474-71d5-ee6b95bf1075. This token needs to be added to a header for all subsequent API calls. e.g.

headers: 
        Authorization: 
                    description: |
                       Used to pass the authentication token to API.
                    type: string
                    required: true
                    example: API 1035837f-f452-c474-71d5-ee6b95bf1075

I've read through the RAML spec, but its not obvious to me if this can be achieved.

Request/response schema/example

Hi,

currently, RAML defines both an example and a schema for a request and response. While I understand that the example is (and should be) just an XML or a JSON which is displayed by the designer/console as code, are there any plans to display the schema a bit differently? AFAIU a schema contains the information about the fields, its data types and it's constraints (max/min values, enum values, etc.). It would be very nice, if the schema would be displayed as kind of a table with the field name, the field type, whether it is required or not, the description, etc. This is was I frequently use when coding against an API to lookup the fields and its allowed values.

Tobias.

Optional properties do not work correctly if used resource type inherits from another resource type

I am not sure whether this is a bug in the API Designer or the RAML specification is not clear enough.

Take a look to the following example:

#%RAML 0.8
title: Test

resourceTypes:
  - base:
      get?:
        responses:
          200:
            description: OK
      post?: 
        responses:
          201:
            description: Created
  - collection:
      type: base
      post?:
        body:
          application/json:
            schema: |
              { "$schema": "http://json-schema.org/draft-03/schema",
                "type": "object",
                "properties": {
                    "value": { "type": "boolean" }
                }
              }
        responses:
          201:
            body:
              application/json:
                schema: |
                  { "$schema": "http://json-schema.org/draft-03/schema",
                    "type": "object",
                    "properties": {
                        "value": { "type": "boolean" }
                    }
                  }

/test:
  type: base
  post:

/test_without_post:
  type: base

/test_deeper_without_post:
  type: collection
  # why is here implicitly a post?

Why has the /test_deeper_without_post a POST? In "base" and "collection" is it defined a optional using the questionmark...

screen shot 2014-03-06 at 15 55 33

NPM package

Would be great to have an NPM package for this project containing just the build output. Pulling the whole source tree into my project is overkill.

API Reference won't show Query Parameter example with value 0

In the detail window of API Portal and API Designer, a Query Parameter whose Example is just a zero ('0') is displayed without the Example. This is true whether the type is integer or string.

You can reproduce this with the RAML and sample file below.

You can see the RAML and sample with correct spacing by going into edit mode.


#%RAML 0.8
baseUri: https://foo.example.com
title: Foo API
version: 0.1

resourceTypes:
  - collection:
      description: | 
        Collection of available <<resourcePathName>>. <br /> <br /> POST creates an <<resourcePathName|!singularize>>. GET shows an index. 
      get:
        description: Get a list of <<resourcePathName>>.
        headers: &commonHeaders
          funky-thang:
            displayName: Its-Your-Thing
            description: Do what you want to do. 
            example: "xyz987654"
          accept: 
            displayName: Accept
            description: MIME types that client is willing to accept.
            example: "*/*"
          content-type: 
            displayName: Content Type
            description: MIME type of document being served.
            example: "application/x-www-form-urlencoded,application/json"
        responses: &commonResponses
          200:
            body:
              application/json:
                example: |
                  <<exampleCollection>>
          404:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> not found" }
          422:
            body:
              application/json:
                example: |
                  {"message": "<<resourcePathName|!singularize>> cannot be processed because it has failed validation" }
          500:
            body:
              application/json:
                example: |
                  {"message": "internal server error" }
        is: [
          pageable
        ]
traits:
  - pageable:
      queryParameters:       
        page:
          description: First page number to display. 
          example: 1
          required: false
          type: integer
        disappearing-zero:
          description: There should be an example below this line with value '0'.
          example: 0
          required: false
          type: integer
        redundancy:
          description: Index of first row to display.
          example: Redundancy begins with an 'r'.
          required: false
          type: string   
        start:
          description: Index of first row to display.
          example: 999
          required: false
          type: integer  
        what-about-a-string-of-zero:
          description: There should be an example below this line with value '0'.
          example: '0'
          required: false
          type: string  
        yet-another-disappearing-zero:
          description: There should be an example below this line with value '0'.
          example: 0
          required: false
          type: integer
/things:
  description: |
    Many things, cabbages and kings.
  type:
    collection:
      exampleCollection: !include things.sample

[{
  "artistId": "110e8300-e32b-41d4-a716-664400445500",
  "artistName": "Daft Punk",
  "description": "French electronic music duo consisting of musicians Guy-Manuel de Homem-Christo and Thomas Bangalter",
  "imageURL": "http://travelhymns.com/wp-content/uploads/2013/06/random-access-memories1.jpg"
  "nationality": {
    "countryCode": "FRA",
    "countryName": "France"
  }
},
{
  "artistId": "110e8300-e32b-41d4-a716-229932554400",
  "artistName": "Pink Floyd",
  "description": "English rock band that achieved international acclaim with their progressive and psychedelic music.",
  "imageURL": "http://www.billboard.com/files/styles/promo_650/public/stylus/1251869-pink-floyd-reunions-617-409.jpg",
  "nationality": {
    "countryCode": "ENG",
    "countryName": "England"
  }
},
{
  "artistId": "11032be3-41d4-4455-a716-664400a71600",
  "artistName": "Radiohead",
  "description": " English rock band from Abingdon, Oxfordshire, formed in 1985",
  "imageURL": "http://www.wired.com/images_blogs/photos/uncategorized/2007/10/01/radiohead.jpg",
  "nationality": {
    "countryCode": "ENG",
    "countryName": "England"
  }
},
]

disappearing-zeros

'Try it' needs a 'Use example values' checkbox

In the API Reference, we have some (body) Headers for some methods. In the Try it panel, the Headers are text fields with example values in gray.

To actually use the example values (which we do, a lot) we must type or copy/paste over them. Our testers find this awkward and onerous. If we had a Use example values checkbox we could save a hell of a lot of clicks or keystrokes.

Not deterministic response merge

Imagine we have a raml modelling some api

#%RAML 0.8

---

title: Configuration Service
baseUri: http://configuration.cf.com/
version: v1
mediaType: application/json


traits:
  - !include http://api.cf.com/patterns/v1/trait-paged.yaml
  - !include http://api.cf.com/patterns/v1/trait-limited.yaml
 
/configurations:
  is: [paged,limited]
  displayName: Configuration properties
  description: Manages configuration properties
  get:
    description: Gets all configuration properties
    responses:
      200:
        description: Property retrieved
      500:
        description: Internal server error


The both traits define the response code 400 differently - description wise.
I would expect that api designer some how combines those descriptions so the both 'natures' are visible to api client.

Currently it uses the first which is declared for the given method ...

Inconsistent state

Is easy to end up with an inconsistent file state if any file fails to save or delete since there is nothing protecting the in-memory file system from failures.

Support for browsing directories

I have successfully hooked up my own filesystem running the api-designer locally. But I noticed the directories don't show up in the sidebar. I have looked into the code, and despite it seems like the folder files of the current directory are parsed and saved, they are not used anywhere. Is this something that is being worked on? I'm trying to add it myself otherwise.

Some guidance will be welcomed, thanks!

API reference truncates Query Parameters

The GET method for a URL in my API takes three Headers and six Query Parameters. Each of these is three lines long (one line each for name, description, and example).

Looking at the detail page for this GET, I see that only the name and description of the last Query Parameter show up. The page truncates so that the example is not shown.

API designer CORS(?) issue

Hi,
We have strange inconvenience regarding the including externals within RAML across domains.

There is sample RAML

#%RAML 0.8
title: hybris Products API
baseUri: http://localhost:8080/
version: v1
mediaType:  application/json

schemas:
  - error : !include http://localhost:8080/patterns/v1/schema-error-message.json

/products:
  get:
    description: Gets all products
    responses:  
     500 :
        body:
         schema : error

The schema content.

{
  "$schema":"http://json-schema.org/draft-04/schema#",
  "title":"error",
  "type":"object",
  "properties":
  {
    "status":
    {
      "type":"integer",
      "minimum":"100",
      "maximum":"599"
    },
    "type":
    {
      "type":"string",
      "pattern":"[a-z]+[[a-z]_]*[a-z]+"
    },
    "message":
    {
      "type":"string"
    },
    "moreInfo":
    {
      "type":"string",
      "format":"uri"
    },
    "details":
    {
      "type":"array",
      "items":
      {
        "$schema":"http://json-schema.org/draft-04/schema#",
        "title":"errorDetail",
        "type":"object",
        "properties":
        {
          "field":
          {
            "type":"string"
          },
          "type":
          {
            "type":"string",
            "pattern":"[a-z]+[[a-z]_]*[a-z]+"
          },
          "message":
          {
            "type":"string"
          },
          "moreInfo":
          {
            "type":"string",
            "format":"uri"
          }
        },
        "required":["type"]
      }
    }
  },
  "required":["status" , "type" ]
}

We have patterns deployed in container where the CORS is enabled(this CORS enablement works for other web apps) :

<filter>
        <filter-name>CORS</filter-name>
        <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
        <init-param>
            <param-name>cors.maxAge</param-name>
            <param-value>1</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>CORS</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

 

The similar CORS enablement is add in the api-designer web app.

We got a strange message issue see snapshot.

  • Surprisingly it does not occur for any other content served remotely like e.g. yaml files containing traits, resource types.
  • What is more - if i download the file and reference it locally it works as a charm
#%RAML 0.8
title: hybris Products API
baseUri: http://localhost:8080/
version: v1
mediaType:  application/json

#schemas:

- error : !include http://localhost:8080/patterns/v1/schema-error-message.json

traits:

The issue occurs on the ( OS X Mavericks 10.9 )

  • Chrome version 35.0.1916.114 (normal , incognito window)
  • FireFox 25.0.1

screen shot 2014-06-13 at 09 58 35

API Designer - Slow Down

While editing a large RAML file, with Schemas, Traits, Resource Types, and Resources, the editor starts to slow down with each successive update until it becomes unusable. Then I need to reboot the server to use the editor again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.