Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample config, API backend generation
!import "common.groovy"
!import "springboot.groovy"
!import "postgres.groovy"
!merge "moreConfig.yaml" #!dominant
!merge "otherConfig.yaml" #!submissive
springboot:
- db: "postgres"
postgres:
- production:
- host: "database.example.com"
- username: "username"
- password: "password"
- staging:
- host: "stagingdb.example.org"
- username: "staging"
- password: "changeme"
- development:
- default: true
- host: "localhost"
- username: "clientdatabase"
- password: "test"
api:
- name: "ClientDatabase"
- type: "springboot"
- entities:
- client:
- id: "PK,AI"
- name:
- type: "string"
- length: 128
- wealth:
- type: "long"
- households:
- relation: "multi household"
- related:
- relation: "multi client"
- household:
- id: "PK,AI"
- address:
- type: "string"
- length: 256
- endpoints:
- "household/calculate_price": ´sum(household.getClients()*.getWealth()) * 0.15´
@artheus
Copy link
Author

artheus commented Sep 25, 2016

I think it might also be a cool idea to use Java 8 Streams for adding functionality to the generated api. Maybe even using streams to override etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment