@stately-cloud/schema
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -21,3 +21,3 @@ import { create, toBinary } from "@bufbuild/protobuf"; | ||
process.stderr.write(`Building schema from ${fullInputPath}`); | ||
// Use TypeScript to parse the input files | ||
// Use TypeScript to parse the input files. | ||
const program = ts.createProgram([fullInputPath], { | ||
@@ -24,0 +24,0 @@ strict: true, |
@@ -118,3 +118,3 @@ import { create, isMessage, setExtension } from "@bufbuild/protobuf"; | ||
id: fieldName, | ||
message: `Field ${fieldName} is invalid`, | ||
message: `value does not satisfy "${valid}"`, | ||
expression: valid, | ||
@@ -135,8 +135,8 @@ })); | ||
!ephemeral && | ||
// Required defaults to true, so it's only not-required if explicitly set to false | ||
fieldConfig.required !== false && | ||
// Booleans are exempt from the "default required" rule, since they can only | ||
// be true or false, and false is their zero value, which means a required | ||
// boolean could only be true. | ||
field.type !== FieldDescriptorProto_Type.BOOL) { | ||
// Required defaults to true for non-bool fields, false for bool | ||
(fieldConfig.required ?? | ||
// Booleans are exempt from the "default required" rule, since they can | ||
// only be true or false, and false is their zero value, which means a | ||
// required boolean could only be true. | ||
field.type !== FieldDescriptorProto_Type.BOOL)) { | ||
fieldConstraints.required = true; | ||
@@ -143,0 +143,0 @@ hasFieldConstraints = true; |
{ | ||
"name": "@stately-cloud/schema", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"author": "Stately Cloud <support@stately.cloud> (https://stately.cloud/)", | ||
@@ -5,0 +5,0 @@ "description": "Schema language for StatelyDB", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
228536