-
Notifications
You must be signed in to change notification settings - Fork 3
/
defaults.edn
32 lines (29 loc) · 1.29 KB
/
defaults.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
; defaults for status codes (override/augment in your project)
; :get {:rsp {:200 {} :204 {}}}
; :post {:rsp {:201 {}}}
; :put {:rsp {:204 {}}}
; :patch {:rsp {:204 {}}}
; :delete {:rsp {:204 {}}}
; :head {:rsp {:200 {}}}
;; an example :rsp {:headers {"X-Powered-By" "Protean"}}
:types {
:String "[a-zA-Z0-9]+"
:Date "(19|20)[0-9][0-9]\\-(0[1-9]|1[0-2])\\-(0[1-9]|([12][0-9]|3[01]))"
:Time "([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]"
:DateTime "(19|20)[0-9][0-9]\\-(0[1-9]|1[0-2])\\-(0[1-9]|([12][0-9]|3[01]))T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]{3}|)(Z|\\+[0-1][0-9]:[03]0)"
:Ip "((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
:Token "[0-9a-zA-Z-_]+"
;; TODO review. Protean validates these types internally but uses custom
;; functions to generate. Overriding these types will also override
;; generation which could mean very big numeric examples.
; :Int "^-?\\d{1,10}$"
; :Long "^-?\\d{1,19}$"
; :Double "^(-?)(0|([1-9][0-9]*))(\\.[0-9]+)?$"
; :Boolean "(true|false)"
; :Uuid "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"
; :Json "^[{].*[}]"
}
;; default content-type where body is present
:default-content-type "application/json; charset=utf-8"
}