-
Notifications
You must be signed in to change notification settings - Fork 18
Add JSON schema for rec_info output #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ab9ff1f
Represent ColorRGBAField as "#RRGGBBAA"
CZDanol 40ef853
Remove unused BytesField
CZDanol 1a9a1d8
opt_check: Fix crash on unknown fields
CZDanol f31b747
validate: Fix crash on unknown fields
CZDanol 78ca837
Field: fix missing type_name declaration
CZDanol f744e94
fields: Pass unknown fields as hex string
CZDanol 039144f
rec_info: Fix not reporting unknown fields
CZDanol 82fbe01
rec_update: Support updating unknown fields
CZDanol caa55e6
opt_check: Reclassify some errors to warnings
CZDanol 1d4ccba
rec_info: Return 1 if opt_check failed
CZDanol df4b0c0
Rework rec_info --validate
CZDanol be04b43
Add JSON schema for rec_info output
CZDanol 1759b7f
rec_info: Validate through JSON schema
CZDanol 828951d
Fix color_rgba regex
CZDanol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Test schemas | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| run: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out repository code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
|
|
||
| - name: Verify schemas up-to-date | ||
| run: | | ||
| python3 utils/gen_schema.py | ||
|
|
||
| if [ -n "$(git status --porcelain)" ]; then | ||
| echo "::error:: Uncommited schema changes. Please run 'python3 utils/gen_schema.py' locally and commit the changes." | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ cbor2~=5.7.1 | |
| jinja2~=3.1.5 | ||
| numpy~=2.2.3 | ||
| simple_parsing~=0.1.7 | ||
| referencing~=0.37.0 | ||
| jsonschema~=4.25.1 | ||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| regions: | ||
| meta: | ||
| payload_offset: 0 | ||
| absolute_offset: 42 | ||
| size: 4 | ||
| used_size: 4 | ||
| main: | ||
| payload_offset: 4 | ||
| absolute_offset: 46 | ||
| size: 230 | ||
| used_size: 23 | ||
| aux: | ||
| payload_offset: 234 | ||
| absolute_offset: 276 | ||
| size: 35 | ||
| used_size: 1 | ||
| root: | ||
| data_size: 312 | ||
| payload_size: 269 | ||
| overhead: 43 | ||
| payload_used_size: 28 | ||
| total_used_size: 71 | ||
| data: | ||
| meta: | ||
| aux_region_offset: 234 | ||
| main: | ||
| material_class: FFF | ||
| transmission_distance: 5.1 | ||
| aux: {} | ||
| unknown_fields: | ||
| main: | ||
| 19ffff: '6474657374' | ||
| raw_data: | ||
| meta: a10218ea | ||
| main: bf0800181bfb401466666666666619ffff6474657374ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | ||
| aux: a000000000000000000000000000000000000000000000000000000000000000000000 | ||
| uri: null | ||
| validate: | ||
| warnings: | ||
| - Region 'main' contains unknown fields | ||
| - Missing recommended field 'gtin' | ||
| - Missing recommended field 'material_type' | ||
| - Missing recommended field 'material_name' | ||
| - Missing recommended field 'brand_name' | ||
| - Missing recommended field 'manufactured_date' | ||
| - Missing recommended field 'nominal_netto_full_weight' | ||
| - Missing recommended field 'actual_netto_full_weight' | ||
| - Missing recommended field 'empty_container_weight' | ||
| - Missing recommended field 'primary_color' | ||
| - Missing recommended field 'tags' | ||
| - Missing recommended field 'density' | ||
| - Missing recommended field 'min_print_temperature' | ||
| - Missing recommended field 'max_print_temperature' | ||
| - Missing recommended field 'preheat_temperature' | ||
| - Missing recommended field 'min_bed_temperature' | ||
| - Missing recommended field 'max_bed_temperature' | ||
| errors: [] | ||
| opt_check: | ||
| warnings: | ||
| - Failed to deduce brand_uuid | ||
| - Failed to deduce material_uuid | ||
| - Failed to deduce package_uuid | ||
| errors: [] | ||
| notes: [] | ||
| uuids: | ||
| brand_uuid: null | ||
| material_uuid: null | ||
| package_uuid: null | ||
| instance_uuid: null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| test_config: | ||
| extra_required_fields: null | ||
| data: | ||
| main: | ||
| material_class: FFF | ||
| unknown_fields: | ||
| main: | ||
| # 27 (= transmission distance): 5.1 | ||
| "181b": "fb4014666666666666" | ||
|
|
||
| # 65535 (invalid value): "test" | ||
| "19ffff": "6474657374" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nechceš to nějak sjednotit s tím dalším textemL Protože hned v dalším odstavci se píše, že rec_info je utilita která umí parsovat data z NFC....