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.
- Java 8
- Maven 3
- 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.
-
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.
- 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.
- 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.
see Contributing
see LICENSE