Error Codes
FA-SCH-002
Available since 0.1.0
A required field is missing, or a field has the wrong kind of value.
| Severity | Error: the definition is not loaded |
|---|---|
| Category | schema |
| Message | Field '{field}' is missing or has the wrong type (expected {expected}). |
| Suggestion | Add '{field}' with a value of type {expected}. |
| Since | 0.1.0 |
Why this happened
A required field is missing, or a field has the wrong kind of value: text where a number is expected, a number written in quotes, a list where one value is expected. The message names the field and the kind of value it expects.
Wrong
A machine without display_name, and a recipe whose duration is written as text:
{
"schema_version": 1,
"id": "mypack:smelt_iron",
"type": "foundry_apparatus:machine_recipe",
"machines": [
"mypack:iron_smelter"
],
"duration": "100"
}recipes/smelt_iron.json:8:15 /duration [FA-SCH-002] Field 'duration' is missing or has the wrong type (expected integer).Fixed
{
"schema_version": 1,
"id": "mypack:smelt_iron",
"type": "foundry_apparatus:machine_recipe",
"machines": [
"mypack:iron_smelter"
],
"duration": 100
}How to fix
- Find the field named in the message (the path after the line number, such as
/duration). - If it is missing, add it. If it is there, give it the expected kind of value: numbers without quotes, text in quotes, lists in
[ ]. - The reference pages list every field with its type.