1b29aeb4f6
Add relative time and date ( #6 )
...
Build, Test & Checkstyle / build (push) Successful in 46s
Adding the ability to set relative times and dates to be returned.
## How do test
You can test using the following yaml-file:
```yml
- method: "GET"
path: "/"
response:
status: 200
headers:
Content-Type: "application/json"
body:
description: "Relative date/time placeholder examples"
# ISO formats (default)
currentTime: "{datetime+0d@08:00}"
today: "{date+0d}"
tomorrow: "{date+1d}"
futureDateTime: "{datetime+2d4h30m}"
pastDateTime: "{datetime-1d@15:30}"
# RFC3339 formats
currentTimeRfc: "{datetime+0d@08:00:rfc3339}"
tomorrowRfc: "{datetime+1d@13:00:rfc3339}"
# Custom formats
todayCustom: "{date+0d:MMM dd, yyyy}"
tomorrowCustom: "{date+1d:EEEE, MMMM d}"
futureCustom: "{datetime+1d@15:30:yyyy-MM-dd HH:mm:ss}"
timeOnly: "{datetime+0d@14:30:HH:mm:ss}"
- method: "GET"
path: "/examples"
response:
status: 200
headers:
Content-Type: "application/json"
body:
calendar:
- event: "Morning standup"
time: "{datetime+1d@09:00}"
date: "{date+1d:EEEE, MMM dd}"
- event: "Client meeting"
time: "{datetime+2d@14:30:rfc3339}"
date: "{date+2d}"
- event: "Weekly review"
time: "{datetime+7d@16:00}"
date: "{date+7d:MMM dd, yyyy}"
```
Reviewed-on: #6
Reviewed-by: Andreas Svanberg <andreass@dsv.su.se>
Co-authored-by: nenzen <nenzen@dsv.su.se>
Co-committed-by: nenzen <nenzen@dsv.su.se>
2025-11-03 23:38:55 +01:00
41a31ca5af
Add index-support, type hints and improve documentation ( #4 )
...
Build, Test & Checkstyle / build (push) Successful in 1m27s
- Adding the ability to use `index.yaml` in folders, so that path `/system1/users` can both be defined using `/system1/users.yaml` and `/system1/users/index.yaml`.
- Adding type hints to placeholders (for example `path: "/{id}"` with the request `/42` can return `{ "id": 42}`)
- Improve documentation
Reviewed-on: #4
Co-authored-by: nenzen <nenzen@dsv.su.se>
Co-committed-by: nenzen <nenzen@dsv.su.se>
2025-06-16 12:41:03 +02:00