Giter Club home page Giter Club logo

raml-dotnet-parser-2's Introduction

RAML.org Website

This repository contains the source code for the raml.org website written in Jekyll

Requirements

Running locally

Pull the code locally:

$ git clone [email protected]:raml-org/raml-org.git

Enter directory:

$ cd raml-org

Install all dependencies:

$ bundle install

Build & run the site:

$ bundle exec jekyll serve

How to add projects to the projects page?

RAML.org includes a projects page that lists tools around RAML that either are community or commercial driven. If you think, your project should be in this list, please fork this repository, add it into the projects.yml file, and send us a PR. We will review and let you know if we will be able to list it.

Another way to make sure your project is linked to our projects page is through assigning topics to your Github project. Links to each topics are below the list of projects on the projects page. The following topics are available:

Topic Description
raml-design Includes projects that specifically support people with the design of RAML documents.
raml-document Includes projects that focus on the documentation of APIs using RAML documents.
raml-build Includes projects that focus on build client or server code based on RAML documents.
raml-parser Includes projects that parses/validates RAML documents.
raml-test Includes projects that support people testing APIs based on RAML documents.
raml-utilities Includes other projects that do not fall into the other topics like converters.

Topics need to be assigned and managed by the owner of a project. Additionally, we still recommend people to search on Github for more projects that might not have these topics assigned.

Contribution

RAML's website is in fact an open source project and your contribution is very much appreciated. Before you start, you should check for open issues or open a fresh issue to start a discussion around an idea that you'd like to see on our website or a bug. If you want to support us fixing issues, please follow the steps below:

  1. Fork the repository on Github and make your changes on the develop branch (or branch off of it).
  2. Run the website to see if you fixed the issue.
  3. Send a pull request (with the develop branch as the target).

We will review your PR, comment if necessary, and merge it into our staging branch stg.

You can contribute to the following:

  • spelling mistakes
  • new projects
  • blog posts
  • and others, after carefully reviewing the issue you created

raml-dotnet-parser-2's People

Contributors

matjanos avatar rickydutton avatar svc-scm avatar woodp avatar

Stargazers

 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

raml-dotnet-parser-2's Issues

Adding nuget package to vs2015 project stalls studio and blows .prj file size up to 1.5MB

Adding the nuget package of a vs2015 project is not a great experience, it:-

  1. Stalls visual studio for minutes during the add operation (with no feedback or warning)
  2. Increases the size of the project file dramatically

It appears to be unnecessarily adding thousands of files from the node_modules directory into the vs project, this causes studio to slow down and stall during simple operations, eg. starting debugging.

Can I safely exclude the node_modules from the vs project?

Can the nuget package be updated so that it does not add these files whenever the package is updated?

Response Headers Never Get Parsed

Hello,

I ran into an issue where response headers were never parsed in the ResponsesBuilder class. It seems that the data type of the value of the response headers dictionary is not the same as that of the value property of the request headers dictionary. Specifically, the data type of the value property of the response headers dictionary is System.Object[] not System.Dynamic.ExpandoObject like the request headers dictionary. So, when this is cast to IDictionary<string, object> it is always null, which results in dynamicRaml always being null in ParametersBuilder. Subsequently, response headers are never parsed.

I believe the real issue is in the underlying JavaScript parser. Ideally, it should return the same data types for the value of the request headers dictionary and the response headers dictionary. That way, when they are cast to IDictionary<string, object> and passed into the ParametersBuilder constructor, it works correctly for both.

As a workaround, I just converted the response headers dictionary to what is expected:

private IDictionary<string, object> GetHeaders(IDictionary<string, object> response)
{
    if (!response.ContainsKey("headers"))
    {
        return null;
    }
    
    dynamic hdrs = response["headers"];
    var headers = new Dictionary<string, object>();
     
    foreach (var header in hdrs)
    {
         headers.Add(header.name, header);
    }

    return headers;
 }

Then, passed that in to the constructor to ParametersBuilder instead of casting values["headers"] as IDictionary<string, object> since it will always be null:

IDictionary<string, object> headers = GetHeaders(value);

list.Add(new Response
{
    Code = pair.Key,
    Description = value.ContainsKey("description") ? value["description"] as string : null,
    Body = GetBody(defaultMediaType, value),
    Headers = headers != null
                        ? new ParametersBuilder(headers).GetAsDictionary()
                        : new Dictionary<string, Parameter>(),
   Annotations = AnnotationsBuilder.GetAnnotations(value)
});

This worked for me, and the headers for my responses are now getting parsed and populated correctly.

Type not parsed when array item is a scalar (issue not solved for type Number)

Hi,

i was using the RAML.Net parser for VS 2015 and i found that for my RAML definition

#%RAML 1.0
title: "WebApi"
mediaType:
- "application/json"
types:
  TestDataObject:
    type: "object"
    properties:
      TestDataList:
        type: "array"
        description: "An array of decimals"
        minItems: 1
        items:
          type: "number"
          format: "double"

the plugin doesnt generate the correct type. Instead of generating a public IList<decimal> TestDataList {get; set;} it generates a public decimal TestDataList {get; set}.

i even tried with the following RAML code and the result was the same.

#%RAML 1.0
title: "WebApi"
mediaType:
- "application/json"
types:
  TestDataObject:
    type: "object"
    properties:
      TestDataList:
        type: number[]
        description: "An array of decimals"
        minItems: 1

can you please investigate the issue?

Thanks and Cheers.
Vivek

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.