Skip to content

Commit

Permalink
Further specify gene-names spec to disallow empty strings #304
Browse files Browse the repository at this point in the history
  • Loading branch information
mluypaert committed Oct 1, 2020
1 parent 710e90f commit fdddbb9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wormbase/specs/gene.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns wormbase.specs.gene
(:require
[clojure.spec.alpha :as s]
[clojure.string :as str]
[phrase.alpha :as ph]
[spec-tools.core :as stc]
[wormbase.specs.biotype :as wsb]
Expand All @@ -10,7 +11,9 @@

(def gene-id-regexp #"WBGene\d{8}")

(s/def ::name (s/and string?))
(s/def ::non-blank-string (s/and string? (complement str/blank?)))

(s/def ::name (s/and ::non-blank-string))

(s/def ::names-coll (s/coll-of ::name))

Expand Down Expand Up @@ -39,7 +42,7 @@
:description "The species associated with the Gene."}))


(s/def :gene/status (stc/spec {:spec string?
(s/def :gene/status (stc/spec {:spec ::non-blank-string
:swagger/example "live"
:description "The status of the Gene."}))

Expand Down

0 comments on commit fdddbb9

Please sign in to comment.