Skip to content

Commit

Permalink
Update README & Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Oct 7, 2017
1 parent 7e7791f commit 1e591c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 0.4.0-SNAPSHOT

* `or` and `and` keys are parsed correctly for JSON Schema & Swagger, Fixes [#79](https://github.com/metosin/spec-tools/issues/79)
* **BREAKING**: `spec-tools.type` is now `spec-tools.parse` with public api of:
* `parse-spec`: given a spec name, form or instance, maybe returns a spec info map with resolved `:type` and optionally other info, e.g. `:keys` for `s/keys` specs.
* `parse-spec`: given a spec name, form or instance, maybe returns a spec info map with resolved `:type` and optionally other info, e.g. `:keys`, `:keys/req` and `:keys/opt` for `s/keys` specs.
* `parse-form`: multimethod to parse info out of a form
* Spec Records of `s/and` are fully resolved now, fixes https://github.com/metosin/compojure-api/issues/336

Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ The following Spec keys having a special meaning:
| `:name` | Name of the spec. Maps to `title` in JSON Schema. |
| `:description` | Description of the spec. Maps to `description` in JSON Schema. |
| `:gen` | Generator function for the Spec (set via `s/with-gen`) |
| `:keys`           | Set of map keys that the spec defines. Extracted from `s/keys` Specs.       |
| `:keys`           | Set of all map keys that the spec defines. Extracted from `s/keys` Specs.   |
| `:keys/req`       | Set of required map keys that the spec defines. Extracted from `s/keys` Specs.|
| `:keys/opt`       | Set of optional map keys that the spec defines. Extracted from `s/keys` Specs.|
| `:reason` | Value is added to `s/explain-data` problems under key `:reason` |
| `:json-schema/...` | Extra data that is merged with unqualifed keys into json-schema |

Expand Down Expand Up @@ -462,7 +464,8 @@ A tool to walk over and transform specs using the [Visitor-pattern](https://en.w
; {:spec (clojure.spec.alpha/keys
; :req-un [:user$person$orders/id :user$person$orders/description])
; :type :map
; :keys #{:id :description}})
; :keys #{:id :description}
; :keys/req #{:id :description}})
; :into [])
; :type :vector})
; :user$person$address/street (spec-tools.core/spec
Expand All @@ -477,7 +480,8 @@ A tool to walk over and transform specs using the [Visitor-pattern](https://en.w
; {:spec (clojure.spec.alpha/keys
; :req-un [:user$person$address/street :user$person$address/zip])
; :type :map
; :keys #{:street :zip}}))
; :keys #{:street :zip}
; :keys/req #{:street :zip}}))
; :type nil})
; :user$person/description (spec-tools.core/spec
; {:spec clojure.core/string?
Expand Down

0 comments on commit 1e591c8

Please sign in to comment.