expressir 2.1.30 → 2.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/docs.yml +98 -0
- data/.github/workflows/links.yml +100 -0
- data/.github/workflows/rake.yml +4 -0
- data/.github/workflows/release.yml +5 -0
- data/.github/workflows/validate_schemas.yml +1 -1
- data/.gitignore +3 -0
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +244 -39
- data/Gemfile +2 -1
- data/README.adoc +621 -54
- data/docs/Gemfile +12 -0
- data/docs/_config.yml +141 -0
- data/docs/_guides/changes/changes-format.adoc +778 -0
- data/docs/_guides/changes/importing-eengine.adoc +898 -0
- data/docs/_guides/changes/index.adoc +396 -0
- data/docs/_guides/changes/programmatic-usage.adoc +1038 -0
- data/docs/_guides/changes/validating-changes.adoc +681 -0
- data/docs/_guides/cli/benchmark-performance.adoc +834 -0
- data/docs/_guides/cli/coverage-analysis.adoc +921 -0
- data/docs/_guides/cli/format-schemas.adoc +547 -0
- data/docs/_guides/cli/index.adoc +8 -0
- data/docs/_guides/cli/managing-changes.adoc +927 -0
- data/docs/_guides/cli/validate-ascii.adoc +645 -0
- data/docs/_guides/cli/validate-schemas.adoc +534 -0
- data/docs/_guides/index.adoc +165 -0
- data/docs/_guides/ler/creating-packages.adoc +664 -0
- data/docs/_guides/ler/index.adoc +305 -0
- data/docs/_guides/ler/loading-packages.adoc +707 -0
- data/docs/_guides/ler/package-formats.adoc +748 -0
- data/docs/_guides/ler/querying-packages.adoc +826 -0
- data/docs/_guides/ler/validating-packages.adoc +750 -0
- data/docs/_guides/liquid/basic-templates.adoc +813 -0
- data/docs/_guides/liquid/documentation-generation.adoc +1042 -0
- data/docs/_guides/liquid/drops-reference.adoc +829 -0
- data/docs/_guides/liquid/filters-and-tags.adoc +912 -0
- data/docs/_guides/liquid/index.adoc +468 -0
- data/docs/_guides/manifests/creating-manifests.adoc +483 -0
- data/docs/_guides/manifests/index.adoc +307 -0
- data/docs/_guides/manifests/resolving-manifests.adoc +557 -0
- data/docs/_guides/manifests/validating-manifests.adoc +713 -0
- data/docs/_guides/ruby-api/formatting-schemas.adoc +605 -0
- data/docs/_guides/ruby-api/index.adoc +257 -0
- data/docs/_guides/ruby-api/parsing-files.adoc +421 -0
- data/docs/_guides/ruby-api/search-engine.adoc +609 -0
- data/docs/_guides/ruby-api/working-with-repository.adoc +577 -0
- data/docs/_pages/data-model.adoc +665 -0
- data/docs/_pages/express-language.adoc +506 -0
- data/docs/_pages/getting-started.adoc +414 -0
- data/docs/_pages/index.adoc +116 -0
- data/docs/_pages/introduction.adoc +256 -0
- data/docs/_pages/ler-packages.adoc +837 -0
- data/docs/_pages/parsers.adoc +683 -0
- data/docs/_pages/schema-manifests.adoc +431 -0
- data/docs/_references/index.adoc +228 -0
- data/docs/_tutorials/creating-ler-package.adoc +735 -0
- data/docs/_tutorials/documentation-coverage.adoc +795 -0
- data/docs/_tutorials/index.adoc +221 -0
- data/docs/_tutorials/liquid-templates.adoc +806 -0
- data/docs/_tutorials/parsing-your-first-schema.adoc +522 -0
- data/docs/_tutorials/querying-schemas.adoc +751 -0
- data/docs/_tutorials/working-with-multiple-schemas.adoc +676 -0
- data/docs/index.adoc +242 -0
- data/docs/lychee.toml +84 -0
- data/examples/demo_ler_usage.sh +86 -0
- data/examples/ler/README.md +111 -0
- data/examples/ler/simple_example.ler +0 -0
- data/examples/ler/simple_schema.exp +33 -0
- data/examples/ler_build.rb +75 -0
- data/examples/ler_cli.rb +79 -0
- data/examples/ler_demo_complete.rb +276 -0
- data/examples/ler_query.rb +91 -0
- data/examples/ler_query_examples.rb +305 -0
- data/examples/ler_stats.rb +81 -0
- data/examples/phase3_demo.rb +159 -0
- data/examples/query_demo_simple.rb +131 -0
- data/expressir.gemspec +2 -0
- data/lib/expressir/cli.rb +12 -4
- data/lib/expressir/commands/manifest.rb +427 -0
- data/lib/expressir/commands/package.rb +1274 -0
- data/lib/expressir/commands/validate.rb +70 -37
- data/lib/expressir/commands/validate_ascii.rb +607 -0
- data/lib/expressir/commands/validate_load.rb +88 -0
- data/lib/expressir/express/formatter.rb +5 -1
- data/lib/expressir/express/formatters/remark_item_formatter.rb +25 -0
- data/lib/expressir/express/parser.rb +33 -0
- data/lib/expressir/manifest/resolver.rb +213 -0
- data/lib/expressir/manifest/validator.rb +195 -0
- data/lib/expressir/model/declarations/entity.rb +6 -0
- data/lib/expressir/model/dependency_resolver.rb +270 -0
- data/lib/expressir/model/indexes/entity_index.rb +103 -0
- data/lib/expressir/model/indexes/reference_index.rb +148 -0
- data/lib/expressir/model/indexes/type_index.rb +149 -0
- data/lib/expressir/model/interface_validator.rb +384 -0
- data/lib/expressir/model/repository.rb +400 -5
- data/lib/expressir/model/repository_validator.rb +295 -0
- data/lib/expressir/model/search_engine.rb +525 -0
- data/lib/expressir/model.rb +4 -94
- data/lib/expressir/package/builder.rb +200 -0
- data/lib/expressir/package/metadata.rb +81 -0
- data/lib/expressir/package/reader.rb +165 -0
- data/lib/expressir/schema_manifest.rb +11 -1
- data/lib/expressir/version.rb +1 -1
- data/lib/expressir.rb +15 -2
- metadata +114 -4
- data/docs/benchmarking.adoc +0 -107
- data/docs/liquid_drops.adoc +0 -1547
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Validate Schemas
|
|
3
|
+
parent: CLI Guides
|
|
4
|
+
grand_parent: Guides
|
|
5
|
+
nav_order: 3
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
== Validate Schemas
|
|
9
|
+
|
|
10
|
+
=== Purpose
|
|
11
|
+
|
|
12
|
+
The `validate load` command checks EXPRESS schemas for syntax errors and version
|
|
13
|
+
string compliance. This ensures schemas are well-formed and properly versioned
|
|
14
|
+
before deployment or further processing.
|
|
15
|
+
|
|
16
|
+
=== References
|
|
17
|
+
|
|
18
|
+
* link:validate-ascii.html[Validate ASCII Content]
|
|
19
|
+
* link:../../tutorials/parsing-your-first-schema.html[Tutorial: Parsing Your First Schema]
|
|
20
|
+
* link:../../pages/express-language.html[EXPRESS Language Documentation]
|
|
21
|
+
* link:format-schemas.html[Format Schemas]
|
|
22
|
+
|
|
23
|
+
=== Concepts
|
|
24
|
+
|
|
25
|
+
Schema validation:: Checking that EXPRESS schema files can be successfully parsed and meet structural requirements
|
|
26
|
+
Version string:: Required metadata in schema declarations identifying the schema version
|
|
27
|
+
Batch validation:: Validating multiple schemas in a single operation
|
|
28
|
+
Schema manifest:: YAML file containing schema definitions that can be validated
|
|
29
|
+
Exit codes:: Command returns 0 for success, 1 for validation failures
|
|
30
|
+
|
|
31
|
+
=== Basic Usage
|
|
32
|
+
|
|
33
|
+
==== Validate Single File
|
|
34
|
+
|
|
35
|
+
[source,bash]
|
|
36
|
+
----
|
|
37
|
+
expressir validate load schema.exp
|
|
38
|
+
----
|
|
39
|
+
|
|
40
|
+
Output on success:
|
|
41
|
+
[source]
|
|
42
|
+
----
|
|
43
|
+
Validating schema.exp
|
|
44
|
+
Validation passed for all EXPRESS schemas.
|
|
45
|
+
----
|
|
46
|
+
|
|
47
|
+
Output on failure:
|
|
48
|
+
[source]
|
|
49
|
+
----
|
|
50
|
+
Validating schema.exp
|
|
51
|
+
******************** RESULTS: FAILED TO PARSE ********************
|
|
52
|
+
Failed to parse: schema.exp
|
|
53
|
+
|
|
54
|
+
******************** RESULTS: MISSING VERSION STRING ********************
|
|
55
|
+
Missing version string: schema `example_schema` | schema.exp
|
|
56
|
+
----
|
|
57
|
+
|
|
58
|
+
==== Validate Multiple Files
|
|
59
|
+
|
|
60
|
+
[source,bash]
|
|
61
|
+
----
|
|
62
|
+
# Explicit files
|
|
63
|
+
expressir validate load schema1.exp schema2.exp schema3.exp
|
|
64
|
+
|
|
65
|
+
# Using wildcards
|
|
66
|
+
expressir validate load schemas/*.exp
|
|
67
|
+
|
|
68
|
+
# Recursive search
|
|
69
|
+
expressir validate load schemas/**/*.exp
|
|
70
|
+
----
|
|
71
|
+
|
|
72
|
+
==== Validate from Schema Manifest
|
|
73
|
+
|
|
74
|
+
[source,bash]
|
|
75
|
+
----
|
|
76
|
+
# Validate all schemas defined in a manifest
|
|
77
|
+
expressir validate load manifest.yaml
|
|
78
|
+
|
|
79
|
+
# With verbose output
|
|
80
|
+
expressir validate load manifest.yaml --verbose
|
|
81
|
+
----
|
|
82
|
+
|
|
83
|
+
==== CI/CD Usage
|
|
84
|
+
|
|
85
|
+
[source,bash]
|
|
86
|
+
----
|
|
87
|
+
# Exit code 0 on success, 1 on failure
|
|
88
|
+
expressir validate load schemas/*.exp
|
|
89
|
+
if [ $? -eq 0 ]; then
|
|
90
|
+
echo "✓ All schemas valid"
|
|
91
|
+
else
|
|
92
|
+
echo "✗ Validation failed"
|
|
93
|
+
exit 1
|
|
94
|
+
fi
|
|
95
|
+
----
|
|
96
|
+
|
|
97
|
+
=== Command Options
|
|
98
|
+
|
|
99
|
+
==== Available Options
|
|
100
|
+
|
|
101
|
+
[options="header"]
|
|
102
|
+
|===
|
|
103
|
+
| Option | Description | Default
|
|
104
|
+
|
|
105
|
+
| `--verbose`
|
|
106
|
+
| Show detailed processing information
|
|
107
|
+
| false
|
|
108
|
+
|
|
109
|
+
| `--help`, `-h`
|
|
110
|
+
| Display help message
|
|
111
|
+
| -
|
|
112
|
+
|===
|
|
113
|
+
|
|
114
|
+
==== Verbose Option
|
|
115
|
+
|
|
116
|
+
[source,bash]
|
|
117
|
+
----
|
|
118
|
+
expressir validate load schema.exp --verbose
|
|
119
|
+
----
|
|
120
|
+
|
|
121
|
+
Provides additional output about the validation process, including schema names and structure information.
|
|
122
|
+
|
|
123
|
+
=== Validation Checks
|
|
124
|
+
|
|
125
|
+
==== Syntax Validation
|
|
126
|
+
|
|
127
|
+
The validator checks that schemas can be successfully parsed according to EXPRESS grammar rules:
|
|
128
|
+
|
|
129
|
+
* **Keywords**: Proper use of EXPRESS keywords
|
|
130
|
+
* **Structure**: Correct entity, type, function declarations
|
|
131
|
+
* **Syntax**: Valid statements, expressions, and references
|
|
132
|
+
* **Encoding**: UTF-8 character encoding
|
|
133
|
+
|
|
134
|
+
Example of syntax errors detected:
|
|
135
|
+
|
|
136
|
+
[source,express]
|
|
137
|
+
----
|
|
138
|
+
SCHEMA invalid_schema;
|
|
139
|
+
ENTITY person
|
|
140
|
+
name : STRING; (* Missing semicolon after ENTITY *)
|
|
141
|
+
END_ENTITY;
|
|
142
|
+
END_SCHEMA;
|
|
143
|
+
----
|
|
144
|
+
|
|
145
|
+
Validation output:
|
|
146
|
+
[source]
|
|
147
|
+
----
|
|
148
|
+
Failed to parse: invalid_schema.exp
|
|
149
|
+
----
|
|
150
|
+
|
|
151
|
+
==== Version String Validation
|
|
152
|
+
|
|
153
|
+
All schemas must include a version declaration:
|
|
154
|
+
|
|
155
|
+
[source,express]
|
|
156
|
+
----
|
|
157
|
+
SCHEMA example_schema;
|
|
158
|
+
-- Valid: includes version
|
|
159
|
+
END_SCHEMA; -- example_schema
|
|
160
|
+
----
|
|
161
|
+
|
|
162
|
+
Missing version:
|
|
163
|
+
[source,express]
|
|
164
|
+
----
|
|
165
|
+
SCHEMA example_schema;
|
|
166
|
+
(* No version declared *)
|
|
167
|
+
END_SCHEMA;
|
|
168
|
+
----
|
|
169
|
+
|
|
170
|
+
Validation output:
|
|
171
|
+
[source]
|
|
172
|
+
----
|
|
173
|
+
Missing version string: schema `example_schema` | example_schema.exp
|
|
174
|
+
----
|
|
175
|
+
|
|
176
|
+
Valid version declaration:
|
|
177
|
+
[source,express]
|
|
178
|
+
----
|
|
179
|
+
SCHEMA example_schema;
|
|
180
|
+
SCHEMA_VERSION('1.0.0');
|
|
181
|
+
END_SCHEMA;
|
|
182
|
+
----
|
|
183
|
+
|
|
184
|
+
=== Use Cases
|
|
185
|
+
|
|
186
|
+
==== Pre-commit Validation
|
|
187
|
+
|
|
188
|
+
Validate schemas before committing to version control:
|
|
189
|
+
|
|
190
|
+
[source,bash]
|
|
191
|
+
----
|
|
192
|
+
#!/bin/bash
|
|
193
|
+
# .git/hooks/pre-commit
|
|
194
|
+
|
|
195
|
+
# Get staged .exp files
|
|
196
|
+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.exp$')
|
|
197
|
+
|
|
198
|
+
if [ -z "$STAGED_FILES" ]; then
|
|
199
|
+
exit 0
|
|
200
|
+
fi
|
|
201
|
+
|
|
202
|
+
echo "Validating staged EXPRESS schemas..."
|
|
203
|
+
|
|
204
|
+
# Validate each staged file
|
|
205
|
+
for file in $STAGED_FILES; do
|
|
206
|
+
if ! expressir validate load "$file"; then
|
|
207
|
+
echo "❌ Validation failed for: $file"
|
|
208
|
+
echo "Please fix validation errors before committing."
|
|
209
|
+
exit 1
|
|
210
|
+
fi
|
|
211
|
+
done
|
|
212
|
+
|
|
213
|
+
echo "✓ All staged schemas are valid"
|
|
214
|
+
----
|
|
215
|
+
|
|
216
|
+
Make it executable:
|
|
217
|
+
[source,bash]
|
|
218
|
+
----
|
|
219
|
+
chmod +x .git/hooks/pre-commit
|
|
220
|
+
----
|
|
221
|
+
|
|
222
|
+
==== CI/CD Pipeline Integration
|
|
223
|
+
|
|
224
|
+
GitHub Actions workflow:
|
|
225
|
+
|
|
226
|
+
[source,yaml]
|
|
227
|
+
----
|
|
228
|
+
name: Validate Schemas
|
|
229
|
+
|
|
230
|
+
on: [push, pull_request]
|
|
231
|
+
|
|
232
|
+
jobs:
|
|
233
|
+
validate:
|
|
234
|
+
runs-on: ubuntu-latest
|
|
235
|
+
steps:
|
|
236
|
+
- uses: actions/checkout@v2
|
|
237
|
+
|
|
238
|
+
- name: Set up Ruby
|
|
239
|
+
uses: ruby/setup-ruby@v1
|
|
240
|
+
with:
|
|
241
|
+
ruby-version: '3.0'
|
|
242
|
+
|
|
243
|
+
- name: Install Expressir
|
|
244
|
+
run: gem install expressir
|
|
245
|
+
|
|
246
|
+
- name: Validate all schemas
|
|
247
|
+
run: |
|
|
248
|
+
echo "Validating EXPRESS schemas..."
|
|
249
|
+
if expressir validate load schemas/*.exp; then
|
|
250
|
+
echo "✓ All schemas valid"
|
|
251
|
+
else
|
|
252
|
+
echo "✗ Schema validation failed"
|
|
253
|
+
exit 1
|
|
254
|
+
fi
|
|
255
|
+
----
|
|
256
|
+
|
|
257
|
+
==== Quality Assurance Script
|
|
258
|
+
|
|
259
|
+
Comprehensive validation script:
|
|
260
|
+
|
|
261
|
+
[source,bash]
|
|
262
|
+
----
|
|
263
|
+
#!/bin/bash
|
|
264
|
+
# validate-all.sh - Complete schema validation
|
|
265
|
+
|
|
266
|
+
set -e
|
|
267
|
+
|
|
268
|
+
SCHEMA_DIR="schemas"
|
|
269
|
+
REPORT_FILE="validation_report.txt"
|
|
270
|
+
|
|
271
|
+
echo "EXPRESS Schema Validation Report" > "$REPORT_FILE"
|
|
272
|
+
echo "================================" >> "$REPORT_FILE"
|
|
273
|
+
echo "Date: $(date)" >> "$REPORT_FILE"
|
|
274
|
+
echo "" >> "$REPORT_FILE"
|
|
275
|
+
|
|
276
|
+
# Count total schemas
|
|
277
|
+
TOTAL=$(find "$SCHEMA_DIR" -name "*.exp" | wc -l)
|
|
278
|
+
echo "Total schemas: $TOTAL" >> "$REPORT_FILE"
|
|
279
|
+
echo "" >> "$REPORT_FILE"
|
|
280
|
+
|
|
281
|
+
# Run validation
|
|
282
|
+
echo "Running validation..." | tee -a "$REPORT_FILE"
|
|
283
|
+
if expressir validate load "$SCHEMA_DIR"/*.exp >> "$REPORT_FILE" 2>&1; then
|
|
284
|
+
echo "✓ All schemas passed validation" | tee -a "$REPORT_FILE"
|
|
285
|
+
exit 0
|
|
286
|
+
else
|
|
287
|
+
echo "✗ Validation failed - see $REPORT_FILE" | tee -a "$REPORT_FILE"
|
|
288
|
+
exit 1
|
|
289
|
+
fi
|
|
290
|
+
----
|
|
291
|
+
|
|
292
|
+
==== Batch Validation with Reporting
|
|
293
|
+
|
|
294
|
+
[source,bash]
|
|
295
|
+
----
|
|
296
|
+
#!/bin/bash
|
|
297
|
+
# validate-with-report.sh
|
|
298
|
+
|
|
299
|
+
VALID=0
|
|
300
|
+
INVALID=0
|
|
301
|
+
MISSING_VERSION=0
|
|
302
|
+
|
|
303
|
+
for file in schemas/*.exp; do
|
|
304
|
+
echo "Checking: $file"
|
|
305
|
+
|
|
306
|
+
OUTPUT=$(expressir validate load "$file" 2>&1)
|
|
307
|
+
STATUS=$?
|
|
308
|
+
|
|
309
|
+
if [ $STATUS -eq 0 ]; then
|
|
310
|
+
echo " ✓ Valid"
|
|
311
|
+
((VALID++))
|
|
312
|
+
else
|
|
313
|
+
if echo "$OUTPUT" | grep -q "Failed to parse"; then
|
|
314
|
+
echo " ✗ Parse error"
|
|
315
|
+
((INVALID++))
|
|
316
|
+
fi
|
|
317
|
+
if echo "$OUTPUT" | grep -q "Missing version"; then
|
|
318
|
+
echo " ⚠ Missing version"
|
|
319
|
+
((MISSING_VERSION++))
|
|
320
|
+
fi
|
|
321
|
+
fi
|
|
322
|
+
done
|
|
323
|
+
|
|
324
|
+
echo ""
|
|
325
|
+
echo "Summary:"
|
|
326
|
+
echo " Valid: $VALID"
|
|
327
|
+
echo " Parse errors: $INVALID"
|
|
328
|
+
echo " Missing version: $MISSING_VERSION"
|
|
329
|
+
|
|
330
|
+
if [ $INVALID -gt 0 ] || [ $MISSING_VERSION -gt 0 ]; then
|
|
331
|
+
exit 1
|
|
332
|
+
fi
|
|
333
|
+
----
|
|
334
|
+
|
|
335
|
+
=== Validation Workflow
|
|
336
|
+
|
|
337
|
+
==== Development Workflow
|
|
338
|
+
|
|
339
|
+
[source,bash]
|
|
340
|
+
----
|
|
341
|
+
# 1. Edit schema
|
|
342
|
+
vim my_schema.exp
|
|
343
|
+
|
|
344
|
+
# 2. Validate
|
|
345
|
+
expressir validate load my_schema.exp
|
|
346
|
+
|
|
347
|
+
# 3. If valid, format
|
|
348
|
+
expressir format my_schema.exp -o my_schema.exp
|
|
349
|
+
|
|
350
|
+
# 4. Commit
|
|
351
|
+
git add my_schema.exp
|
|
352
|
+
git commit -m "Add my_schema"
|
|
353
|
+
----
|
|
354
|
+
|
|
355
|
+
==== Team Workflow
|
|
356
|
+
|
|
357
|
+
[source,bash]
|
|
358
|
+
----
|
|
359
|
+
# 1. Validate all schemas
|
|
360
|
+
expressir validate load schemas/*.exp
|
|
361
|
+
|
|
362
|
+
# 2. Fix any errors
|
|
363
|
+
# (edit files as needed)
|
|
364
|
+
|
|
365
|
+
# 3. Re-validate
|
|
366
|
+
expressir validate load schemas/*.exp
|
|
367
|
+
|
|
368
|
+
# 4. Proceed with deployment
|
|
369
|
+
./deploy.sh
|
|
370
|
+
----
|
|
371
|
+
|
|
372
|
+
=== Common Validation Errors
|
|
373
|
+
|
|
374
|
+
==== Parse Errors
|
|
375
|
+
|
|
376
|
+
**Missing Semicolon**
|
|
377
|
+
|
|
378
|
+
[source,express]
|
|
379
|
+
----
|
|
380
|
+
ENTITY person
|
|
381
|
+
name : STRING; (* Missing semicolon after entity name *)
|
|
382
|
+
----
|
|
383
|
+
|
|
384
|
+
**Solution**: Add semicolon after ENTITY declaration:
|
|
385
|
+
[source,express]
|
|
386
|
+
----
|
|
387
|
+
ENTITY person;
|
|
388
|
+
name : STRING;
|
|
389
|
+
----
|
|
390
|
+
|
|
391
|
+
**Invalid Keyword**
|
|
392
|
+
|
|
393
|
+
[source,express]
|
|
394
|
+
----
|
|
395
|
+
ENTITTY person; (* Typo in keyword *)
|
|
396
|
+
----
|
|
397
|
+
|
|
398
|
+
**Solution**: Correct the keyword spelling.
|
|
399
|
+
|
|
400
|
+
**Unclosed Block**
|
|
401
|
+
|
|
402
|
+
[source,express]
|
|
403
|
+
----
|
|
404
|
+
SCHEMA example;
|
|
405
|
+
ENTITY person;
|
|
406
|
+
name : STRING;
|
|
407
|
+
(* Missing END_ENTITY *)
|
|
408
|
+
END_SCHEMA;
|
|
409
|
+
----
|
|
410
|
+
|
|
411
|
+
**Solution**: Add missing END_ENTITY.
|
|
412
|
+
|
|
413
|
+
==== Version String Errors
|
|
414
|
+
|
|
415
|
+
**Missing Version**
|
|
416
|
+
|
|
417
|
+
[source,express]
|
|
418
|
+
----
|
|
419
|
+
SCHEMA example_schema;
|
|
420
|
+
(* No version declared *)
|
|
421
|
+
END_SCHEMA;
|
|
422
|
+
----
|
|
423
|
+
|
|
424
|
+
**Solution**: Add SCHEMA_VERSION declaration:
|
|
425
|
+
[source,express]
|
|
426
|
+
----
|
|
427
|
+
SCHEMA example_schema;
|
|
428
|
+
SCHEMA_VERSION('1.0.0');
|
|
429
|
+
END_SCHEMA;
|
|
430
|
+
----
|
|
431
|
+
|
|
432
|
+
**Invalid Version Format**
|
|
433
|
+
|
|
434
|
+
While any string is technically valid, use semantic versioning:
|
|
435
|
+
[source,express]
|
|
436
|
+
----
|
|
437
|
+
SCHEMA example_schema;
|
|
438
|
+
SCHEMA_VERSION('1.0.0'); (* Recommended format *)
|
|
439
|
+
END_SCHEMA;
|
|
440
|
+
----
|
|
441
|
+
|
|
442
|
+
=== Error Messages
|
|
443
|
+
|
|
444
|
+
==== Failed to Parse
|
|
445
|
+
|
|
446
|
+
[source]
|
|
447
|
+
----
|
|
448
|
+
******************** RESULTS: FAILED TO PARSE ********************
|
|
449
|
+
Failed to parse: schema.exp
|
|
450
|
+
----
|
|
451
|
+
|
|
452
|
+
**Meaning**: The schema file contains syntax errors that prevent parsing.
|
|
453
|
+
|
|
454
|
+
**Actions**:
|
|
455
|
+
1. Open the file in an editor
|
|
456
|
+
2. Check for common syntax errors
|
|
457
|
+
3. Validate EXPRESS grammar rules
|
|
458
|
+
4. Test with a minimal schema first
|
|
459
|
+
|
|
460
|
+
==== Missing Version String
|
|
461
|
+
|
|
462
|
+
[source]
|
|
463
|
+
----
|
|
464
|
+
******************** RESULTS: MISSING VERSION STRING ********************
|
|
465
|
+
Missing version string: schema `example_schema` | schema.exp
|
|
466
|
+
----
|
|
467
|
+
|
|
468
|
+
**Meaning**: The schema lacks a SCHEMA_VERSION declaration.
|
|
469
|
+
|
|
470
|
+
**Actions**:
|
|
471
|
+
1. Add SCHEMA_VERSION to the schema
|
|
472
|
+
2. Use semantic versioning format
|
|
473
|
+
3. Document version in project metadata
|
|
474
|
+
|
|
475
|
+
=== Best Practices
|
|
476
|
+
|
|
477
|
+
**Validate Before Committing**::
|
|
478
|
+
Always validate schemas before version control operations
|
|
479
|
+
+
|
|
480
|
+
[source,bash]
|
|
481
|
+
----
|
|
482
|
+
expressir validate load schema.exp && git commit -m "Update schema"
|
|
483
|
+
----
|
|
484
|
+
|
|
485
|
+
**Automate Validation**::
|
|
486
|
+
Add validation to CI/CD pipelines
|
|
487
|
+
+
|
|
488
|
+
[source,bash]
|
|
489
|
+
----
|
|
490
|
+
# In CI script
|
|
491
|
+
expressir validate load schemas/*.exp || exit 1
|
|
492
|
+
----
|
|
493
|
+
|
|
494
|
+
**Use Exit Codes**::
|
|
495
|
+
Check validation results programmatically
|
|
496
|
+
+
|
|
497
|
+
[source,bash]
|
|
498
|
+
----
|
|
499
|
+
if expressir validate load schema.exp; then
|
|
500
|
+
echo "Valid - proceeding"
|
|
501
|
+
else
|
|
502
|
+
echo "Invalid - stopping"
|
|
503
|
+
exit 1
|
|
504
|
+
fi
|
|
505
|
+
----
|
|
506
|
+
|
|
507
|
+
**Validate After Format**::
|
|
508
|
+
Ensure formatting didn't introduce errors
|
|
509
|
+
+
|
|
510
|
+
[source,bash]
|
|
511
|
+
----
|
|
512
|
+
expressir format schema.exp -o schema.exp
|
|
513
|
+
expressir validate load schema.exp
|
|
514
|
+
----
|
|
515
|
+
|
|
516
|
+
**Keep Versions Updated**::
|
|
517
|
+
Maintain accurate version strings in all schemas
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
=== Next Steps
|
|
522
|
+
|
|
523
|
+
**Related Commands**::
|
|
524
|
+
* link:validate-ascii.html[Validate ASCII Content] - Check for non-ASCII characters
|
|
525
|
+
* link:format-schemas.html[Format Schemas] - Pretty-print schemas
|
|
526
|
+
* link:coverage-analysis.html[Coverage Analysis] - Check documentation
|
|
527
|
+
|
|
528
|
+
**Advanced Topics**::
|
|
529
|
+
* link:../ruby-api/parsing-files.html[Ruby API Parsing] - Programmatic validation
|
|
530
|
+
* link:../deployment/ci-cd-setup.html[CI/CD Setup] - Automated workflows
|
|
531
|
+
|
|
532
|
+
**Quality Assurance**::
|
|
533
|
+
* link:benchmark-performance.html[Benchmark Performance] - Performance testing
|
|
534
|
+
* link:../../tutorials/working-with-multiple-schemas.html[Working with Multiple Schemas]
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Overview
|
|
3
|
+
has_children: true
|
|
4
|
+
nav_order: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
= Overview
|
|
8
|
+
|
|
9
|
+
Task-oriented guides that show you how to accomplish specific goals with Expressir. Each guide focuses on a particular aspect or workflow.
|
|
10
|
+
|
|
11
|
+
== About These Guides
|
|
12
|
+
|
|
13
|
+
The guides are organized by topic area:
|
|
14
|
+
|
|
15
|
+
* *CLI* - Command-line interface usage and commands
|
|
16
|
+
* *Ruby API* - Programmatic usage from Ruby code
|
|
17
|
+
* *LER* - Working with LER packages
|
|
18
|
+
* *Manifests* - Managing schema collections with manifests
|
|
19
|
+
* *Changes* - Tracking and managing schema changes
|
|
20
|
+
* *Liquid* - Template integration and documentation generation
|
|
21
|
+
* *Deployment* - Production deployment patterns
|
|
22
|
+
|
|
23
|
+
== Guide Categories
|
|
24
|
+
|
|
25
|
+
=== link:../cli/[CLI Guides]
|
|
26
|
+
|
|
27
|
+
Learn to use Expressir's command-line tools effectively.
|
|
28
|
+
|
|
29
|
+
*Available guides:*
|
|
30
|
+
|
|
31
|
+
* link:../cli/format-schemas.html[Formatting Schemas] - Pretty-print and clean schemas
|
|
32
|
+
* link:../cli/validate-schemas.html[Validating Schemas] - Ensure schema correctness
|
|
33
|
+
* link:../cli/benchmark-performance.html[Benchmarking Performance] - Measure and optimize
|
|
34
|
+
* link:../cli/coverage-analysis.html[Coverage Analysis] - Check documentation coverage
|
|
35
|
+
* link:../cli/managing-changes.html[Managing Changes] - Work with change files
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
=== link:../ruby-api/[Ruby API Guides]
|
|
40
|
+
|
|
41
|
+
Integrate Expressir into your Ruby applications.
|
|
42
|
+
|
|
43
|
+
*Available guides:*
|
|
44
|
+
|
|
45
|
+
* link:../ruby-api/parsing-files.html[Parsing Files] - Load EXPRESS schemas
|
|
46
|
+
* link:../ruby-api/working-with-repository.html[Working with Repository] - Navigate schema collections
|
|
47
|
+
* link:../ruby-api/formatting-schemas.html[Formatting Schemas] - Format schemas programmatically
|
|
48
|
+
* link:../ruby-api/search-engine.html[Search Engine] - Use the search API
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
=== link:../ler/[LER Guides]
|
|
53
|
+
|
|
54
|
+
Work with high-performance LER packages.
|
|
55
|
+
|
|
56
|
+
*Available guides:*
|
|
57
|
+
|
|
58
|
+
* link:../ler/creating-packages.html[Creating Packages] - Build LER files
|
|
59
|
+
* link:../ler/loading-packages.html[Loading Packages] - Use pre-built packages
|
|
60
|
+
* link:../ler/querying-packages.html[Querying Packages] - Search and filter
|
|
61
|
+
* link:../ler/validating-packages.html[Validating Packages] - Ensure package integrity
|
|
62
|
+
* link:../ler/package-formats.html[Package Formats] - Choose serialization formats
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
=== link:../manifests/[Manifest Guides]
|
|
67
|
+
|
|
68
|
+
Manage schema collections with manifests for reproducible builds.
|
|
69
|
+
|
|
70
|
+
*Available guides:*
|
|
71
|
+
|
|
72
|
+
* link:../manifests/creating-manifests.html[Creating Manifests] - Generate manifests from root schemas
|
|
73
|
+
* link:../manifests/resolving-manifests.html[Resolving Manifests] - Auto-resolve missing schema paths
|
|
74
|
+
* link:../manifests/validating-manifests.html[Validating Manifests] - Ensure manifest completeness and integrity
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
=== link:../changes/[Changes Guides]
|
|
79
|
+
|
|
80
|
+
Track and manage schema modifications across versions.
|
|
81
|
+
|
|
82
|
+
*Available guides:*
|
|
83
|
+
|
|
84
|
+
* link:../changes/changes-format.html[Changes Format] - Understanding the format
|
|
85
|
+
* link:../changes/validating-changes.html[Validating Changes] - Verify change files
|
|
86
|
+
* link:../changes/importing-eengine.html[Importing from eengine] - Convert eengine XML
|
|
87
|
+
* link:../changes/programmatic-usage.html[Programmatic Usage] - Use changes API
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
=== link:../liquid/[Liquid Guides]
|
|
92
|
+
|
|
93
|
+
Generate documentation using Liquid templates.
|
|
94
|
+
|
|
95
|
+
*Available guides:*
|
|
96
|
+
|
|
97
|
+
* link:../liquid/basic-templates.html[Basic Templates] - Create simple templates
|
|
98
|
+
* link:../liquid/filters-and-tags.html[Filters and Tags] - Use Liquid features
|
|
99
|
+
* link:../liquid/drops-reference.html[Drops Reference] - Access model data
|
|
100
|
+
* link:../liquid/documentation-generation.html[Documentation Generation] - Generate docs
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
=== link:../deployment/[Deployment Guides]
|
|
105
|
+
|
|
106
|
+
Deploy Expressir in production environments.
|
|
107
|
+
|
|
108
|
+
*Available guides:*
|
|
109
|
+
|
|
110
|
+
* link:../deployment/integrating-rails.html[Integrating with Rails] - Use in Rails apps
|
|
111
|
+
* link:../deployment/gem-configuration.html[Gem Configuration] - Configure for production
|
|
112
|
+
* link:../deployment/performance-tuning.html[Performance Tuning] - Optimize for scale
|
|
113
|
+
|
|
114
|
+
== Using These Guides
|
|
115
|
+
|
|
116
|
+
=== Guide Format
|
|
117
|
+
|
|
118
|
+
Each guide follows a structured format:
|
|
119
|
+
|
|
120
|
+
. *Purpose* - What the guide covers
|
|
121
|
+
. *References* - Related documentation
|
|
122
|
+
. *Concepts* - Key terminology
|
|
123
|
+
. *Instructions* - Step-by-step procedures with examples
|
|
124
|
+
. *Best practices* - Recommended approaches
|
|
125
|
+
. *Troubleshooting* - Common issues and solutions
|
|
126
|
+
|
|
127
|
+
=== Finding the Right Guide
|
|
128
|
+
|
|
129
|
+
*If you want to...*
|
|
130
|
+
|
|
131
|
+
* Use the command-line tools → Start with link:../cli/[CLI Guides]
|
|
132
|
+
* Write Ruby code → Begin with link:../ruby-api/[Ruby API Guides]
|
|
133
|
+
* Work with packages → Explore link:../ler/[LER Guides]
|
|
134
|
+
* Manage schema collections → See link:../manifests/[Manifest Guides]
|
|
135
|
+
* Track changes → Check link:../changes/[Changes Guides]
|
|
136
|
+
* Generate docs → See link:../liquid/[Liquid Guides]
|
|
137
|
+
* Deploy to production → Review link:../deployment/[Deployment Guides]
|
|
138
|
+
|
|
139
|
+
=== Quick Reference
|
|
140
|
+
|
|
141
|
+
For quick answers, use the link:../references/[References] section:
|
|
142
|
+
|
|
143
|
+
* link:../references/cli-commands.html[CLI Commands Reference]
|
|
144
|
+
* link:../references/ruby-api.html[Ruby API Reference]
|
|
145
|
+
* link:../references/data-model/[Data Model Reference]
|
|
146
|
+
|
|
147
|
+
== Getting Help
|
|
148
|
+
|
|
149
|
+
If a guide doesn't cover your specific use case:
|
|
150
|
+
|
|
151
|
+
* Check the link:../tutorials/[Tutorials] for learning-focused content
|
|
152
|
+
* Review the link:../references/[References] for detailed specifications
|
|
153
|
+
* Search https://github.com/lutaml/expressir/issues[GitHub Issues] for similar questions
|
|
154
|
+
* Ask in https://github.com/lutaml/expressir/discussions[GitHub Discussions]
|
|
155
|
+
|
|
156
|
+
== Contributing
|
|
157
|
+
|
|
158
|
+
Help improve these guides:
|
|
159
|
+
|
|
160
|
+
* Report unclear or missing information
|
|
161
|
+
* Suggest new guides for common tasks
|
|
162
|
+
* Share your own usage patterns
|
|
163
|
+
* Submit pull requests with improvements
|
|
164
|
+
|
|
165
|
+
See the https://github.com/lutaml/expressir/blob/main/CONTRIBUTING.md[Contributing Guide] for details.
|