Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raml-org/raml-dotnet-parser
Community-maintained .NET parser for RAML
https://github.com/raml-org/raml-dotnet-parser
dot-net raml raml-parser raml-tooling
Last synced: about 2 months ago
JSON representation
Community-maintained .NET parser for RAML
- Host: GitHub
- URL: https://github.com/raml-org/raml-dotnet-parser
- Owner: raml-org
- License: apache-2.0
- Archived: true
- Created: 2015-02-09T23:01:50.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T14:27:53.000Z (almost 3 years ago)
- Last Synced: 2024-09-25T20:43:34.137Z (about 2 months ago)
- Topics: dot-net, raml, raml-parser, raml-tooling
- Language: C#
- Homepage:
- Size: 72.4 MB
- Stars: 22
- Watchers: 17
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.MD
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# RAML Parser for .NET
[![Build status](https://ci.appveyor.com/api/projects/status/qt828j3w0w6talnr?svg=true)](https://ci.appveyor.com/project/woodp/raml-dotnet-parser)
A RAML Parser implementation in .NET for all CLR languages. The parser is implemented as a strongly-typed wrapper around the JavaScript parser, leveraging Edge.js as a Node.js host. Reuse of the JavaScript parser provides a robust and high-performance parser with a simple and natural .NET object model.
The preferred way of consuming the RAML parser in your .NET application is to include it in your project directly from nuget:
```ps
Install-Package RAML.Parser
```## Usage (C#)
Import the Raml.Parser namespace, and then use the RamlParser object to build an in-memory model of a RAML definition:
```csharp
using RAML.Parser;
async Task ParseRamlFile()
{
// load a RAML file
var parser = new AmfParser();
var model = await parser.Load("my.raml");// print the number of endpoints that this RAML definition contains
Console.WriteLine(model.WebApi.EndPoints.Count());
// print the number of types this RAML definition contains
Console.WriteLine(model.Shapes.Count());// OAS 2.0 also supported
model = await parser.Load("my.json");
}
```The Load methods of the parser return a RamlDocument instance, from which all properties of the RAML definition may
be discovered.