oliyh / martian

The HTTP abstraction library for Clojure/script, supporting OpenAPI, Swagger, Schema, re-frame and more
MIT License
525 stars 42 forks source link

Support date-time and int-or-string string formats #155

Closed jcdlbs closed 1 year ago

jcdlbs commented 1 year ago

These changes assist with using the Kubernetes API which makes use of date-time fields and has the concept of a int-or-string format.

Without the int-or-string type - Martian gives a validation error when trying to use the ':port 8080' in a kubernetes readiness check complaining that a String is required. :port 8080 is a valid value as-is :port "https" and they have different meanings to Kubernetes.

I'm not sure if this specific use case makes sense for upstream and the tests for these enhancements could probably be expanded but I figured I'd submit this pull request just in case.

oliyh commented 1 year ago

Thanks! The int-or-string does sound like quite a specific case but it won't collide with anything else so I'm happy to have it as part of the core library.

Thank you for the contribution, I will publish a snapshot build next week.

oliyh commented 1 year ago

Hi, this is in 0.1.22-SNAPSHOT on clojars now

jcdlbs commented 1 year ago

Excellent, thanks!!

On Mon, Nov 7, 2022 at 7:22 AM Oliver Hine @.***> wrote:

Hi, this is in 0.1.22-SNAPSHOT on clojars now

— Reply to this email directly, view it on GitHub https://github.com/oliyh/martian/pull/155#issuecomment-1305527675, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBIA7QVCVAWF5YHPOUJVQLWHDX6ZANCNFSM6AAAAAARYEHCOU . You are receiving this because you authored the thread.Message ID: @.***>