Commit 7162a0d
Convert StrippedConstraint to PatternConstraint subclass
StrippedConstraint now extends PatternConstraint, using the same
constructor as every other concrete constraint. Custom validate()
and __get_pydantic_json_schema__() eliminated.
Uses \Z (absolute end-of-string) instead of $ because Python's $
matches before a trailing \n. JSON schema emission swaps \Z back
to $ since ECMA regex treats $ as absolute end-of-string.
Signed-off-by: Seth Fitzsimmons <sethfitz@amazon.com>1 parent c19b6b1 commit 7162a0d
2 files changed
Lines changed: 26 additions & 28 deletions
File tree
- packages/overture-schema-system
- src/overture/schema/system/field_constraint
- tests/field_constraint
Lines changed: 16 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
| 211 | + | |
| 212 | + | |
213 | 213 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
225 | | - | |
226 | | - | |
227 | | - | |
| 230 | + | |
| 231 | + | |
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
| |||
Lines changed: 10 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
| |||
174 | 180 | | |
175 | 181 | | |
176 | 182 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
193 | 186 | | |
194 | 187 | | |
195 | 188 | | |
| |||
294 | 287 | | |
295 | 288 | | |
296 | 289 | | |
| 290 | + | |
297 | 291 | | |
298 | 292 | | |
299 | 293 | | |
| |||
0 commit comments