Skip to content

Service DSL is an xtext-based embeddable component for any xtext-based DSL adding capability to make a call to backend services such as REST or GraphQL.

License

Notifications You must be signed in to change notification settings

graph-quilt/xtext-service-dsl

Repository files navigation

Service DSL

Builds CircleCI

Overview

The project provides an xtext-based language and runtime engine for defining and executing HTTP service stub(s). This can be used independently or imported in other Xtext DSLs projects to add capability to make a service call. This project comes with a runtime engine based on Spring Web Client. It should be easy to come up with a runtime engine using any other java based http clients.

Example:

Service SomeRestService as getSomeData method GET  {
  Url -> @Config("endpoint")
  Path -> ${"/v1/consents"}
  Timeout -> ${@Config("timeout")}
  @Header accept -> ${"*/*"}
}

It is up to the importing language whether to execute the service stub explicitly or implicitly.

For now, only REST Services will be supported, but we want to support GraphQL and gRPC in the future.

Pre-requisites

  1. Java 8
  2. Maven 3

Making changes to Runtime

  • Clone this project.
  • Run maven clean install
  • Import the runtime module web-client-service-evaluator. This is standard java maven project which can be imported in your favorite java editor.

Making changes to the language

-- Installing the Software

  • Download and install Eclipse. You might run into a JVM error while installing. Please edit the info.plist file with your java path. StackOverFlow Reference

  • Install Xtext SDK in Eclipse:

    • In Eclipse, click Help --> Install New Software
    • In Available Software, click Add to add a repository with this location
    • Select the repository just added in Work with drop-down
    • Select and install Xtext Complete SDK (2.25.0)
  • Restart Eclipse.

-- Setting up the Project

  • Clone this project
  • Import the project in Eclipse, click File --> Import Project --> Maven --> Existing Maven Project
  • Under com.intuit.dsl.service, right click on [GenerateGraphQL.mwe2] --> Run As --> MWE2 Workflow
  • Edit the Grammar and perform Step 3 again.

-- Manually building the Eclipse plugin.

  • Ensure you've setup your project following the instructions above
  • Create a new "Run Configuration" as an "Eclipse Application" and name it appropriately
  • When you run this new configuration, a new Eclipse Window will open, in which you can create service files and edit them.

Contributing

see Contributing

License

see LICENSE

About

Service DSL is an xtext-based embeddable component for any xtext-based DSL adding capability to make a call to backend services such as REST or GraphQL.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published