ValidationError for valid smithing_transform recipe
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 53/100
Direzione di ricerca
Start with the SmithingTransformRecipe validation reached through SmithingPage and inspect how recipe ingredients and results are modeled. Reproduce the failure using the linked smithing recipe examples, including object and array forms for base, addition, and template. Done when valid smithing_transform recipes validate and the reported web book build succeeds.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Using hexdoc 2.0.0rc1 (with Hex Casting 1.21.1 dev-53)
hexdoc fails to build the web book because of a ValidationError.
Example run:
https://github.com/hauveli/fishcasting/actions/runs/38210665289/job/114683851584
Files which (I think) are failing the validation:
https://github.com/hauveli/fishcasting/blob/main/src/common/main/resources/data/fishcasting/recipe/shepherds_rod_smithing.json
https://github.com/hauveli/fishcasting/blob/main/src/common/main/resources/data/fishcasting/recipe/blessed_bobber_smithing.json
https://github.com/hauveli/fishcasting/blob/main/src/common/main/resources/data/fishcasting/recipe/crystal_casting_rod_smithing.json (Edit: I think this one may also be relevant, as it is also referenced.)
(Edit: These are the patchouli pages affected)
https://github.com/hauveli/fishcasting/blob/main/src/common/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/items/casting_rod.json
https://github.com/hauveli/fishcasting/blob/main/src/common/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/greatwork/fanciful_fishing.json
Possibly of note here, is that base, addition and template can be an Object or an Array of Objects, and still work in game.
Based on Misode, for 26.3 this becomes a String or an Array (of Strings).
Excerpts for the field "base" to show more clearly what I am referring to:
(from shepherds_rod_smithing.json)
"base": {
"item": "tide:crystal_fishing_rod"
},
(from blessed_bobber_smithing.json)
"base": [
{
"item": "tide:amethyst_bobber"
}
],
The error from the example run:
│ /home/runner/work/fishcasting/fishcasting/.venv/lib/python3.12/site-packages │
│ /hexdoc/cli/ci.py:51 in build │
│ │
│ 48 │ │ pages_url = get_pages_url(env.repo) │
│ 49 │ os.environ["GITHUB_PAGES_URL"] = pages_url │
│ 50 │ │
│ ❱ 51 │ site_path = hexdoc_app.build( │
│ 52 │ │ Path("_site/src/docs"), │
│ 53 │ │ clean=True, │
│ 54 │ │ branch=env.branch, │
│ │
│ /home/runner/work/fishcasting/fishcasting/.venv/lib/python3.12/site-packages │
│ /hexdoc/cli/app.py:264 in build │
│ │
│ [261](https://github.com/hauveli/fishcasting/actions/runs/38210665289/job/114683851584#step:6:275) │ │ │ │ │ i18n=i18n, │
│ [262](https://github.com/hauveli/fishcasting/actions/runs/38210665289/job/114683851584#step:6:276) │ │ │ │ │ all_metadata=all_metadata, │
│ [263](https://github.com/hauveli/fishcasting/actions/runs/38210665289/job/114683851584#step:6:277) │ │ │ │ ) as context: │
│ ❱ [264](https://github.com/hauveli/fishcasting/actions/runs/38210665289/job/114683851584#step:6:278) │ │ │ │ │ book = book_plugin.validate_book(book_data, contex │
│ [265](https://github.com/hauveli/fishcasting/actions/runs/38210665289/job/114683851584#step:6:279) │ │ │ │ books.append( │
│ [266](https://github.com/hauveli/fishcasting/actions/runs/38210665289/job/114683851584#step:6:280) │ │ │ │ │ LoadedBookInfo( │
│ [267](https://github.com/hauveli/fishcasting/actions/runs/38210665289/job/114683851584#step:6:281) │ │ │ │ │ │ language=language, │
│ │
│ /home/runner/work/fishcasting/fishcasting/.venv/lib/python3.12/site-packages │
│ /hexdoc/_hooks.py:169 in validate_book │
│ │
│ 166 │ │ │
│ 167 │ │ book = Book.model_validate(book_data, context=cast_context(con │
│ 168 │ │ book._load_categories(context, book_ctx) │
│ ❱ 169 │ │ book._load_entries(context, book_ctx, loader) │
│ 170 │ │ │
│ 171 │ │ return book │
│ 172 │
│ │
│ /home/runner/work/fishcasting/fishcasting/.venv/lib/python3.12/site-packages │
│ /hexdoc/patchouli/book.py:130 in _load_entries │
│ │
│ 127 │ │ │ folder="entries", │
│ 128 │ │ │ use_resource_pack=self.use_resource_pack, │
│ 129 │ │ ): │
│ ❱ 130 │ │ │ entry = Entry.load(resource_dir, id, data, cast_context(co │
│ 131 │ │ │ if not entry.is_flag_enabled: │
│ 132 │ │ │ │ logger.info(f"Skipping entry {id} due to disabled flag │
│ 133 │ │ │ │ continue │
│ │
│ /home/runner/work/fishcasting/fishcasting/.venv/lib/python3.12/site-packages │
│ /hexdoc/model/id.py:35 in load │
│ │
│ 32 │ │ context: dict[str, Any], │
│ 33 │ ) -> Self: │
│ 34 │ │ logger.log(TRACE, f"Load {cls} at {id}") │
│ ❱ 35 │ │ return cls.model_validate( │
│ 36 │ │ │ data | {"id": id, "resource_dir": resource_dir}, │
│ 37 │ │ │ context=context, │
│ 38 │ │ ) │
│ │
│ /home/runner/work/fishcasting/fishcasting/.venv/lib/python3.12/site-packages │
│ /pydantic/main.py:732 in model_validate │
│ │
│ 729 │ │ │ │ code='validate-by-alias-and-name-false', │
│ 730 │ │ │ ) │
│ 731 │ │ │
│ ❱ 732 │ │ return cls.__pydantic_validator__.validate_python( │
│ 733 │ │ │ obj, │
│ 734 │ │ │ strict=strict, │
│ 735 │ │ │ extra=extra, │
╰──────────────────────────────────────────────────────────────────────────────╯
ValidationError: 2 validation errors for Entry
pages.2.Page
Failed to match union <class 'hexdoc.patchouli.page.abstract_pages.Page'>: No
match found
Types: <class 'hexdoc.patchouli.page.pages.SmithingPage'>
Value: {'type': 'patchouli:smithing', 'recipe':
'fishcasting:crystal_casting_rod_smithing', 'text':
'fishcasting.page.casting_rod.smithing', '__resolved': True}
Tag: type=patchouli:smithing [type=TaggedUnionMatchErrorGroup,
input_value={'type': 'patchouli:smith...e.casting_rod.smithing'},
input_type=dict]
pages.2.Page.SmithingPage
ValidationError: 2 validation errors for SmithingPage
recipe.SmithingRecipe
Failed to match union <class
'hexdoc.minecraft.recipe.recipes.SmithingRecipe'>: No match found
Types: <class 'hexdoc.minecraft.recipe.recipes.SmithingTransformRecipe'>
Value: {'type': 'minecraft:smithing_transform', 'addition': {'item':
'hexcasting:charged_amethyst', '__resolved': True}, 'base': [{'item':
'minecraft:fishing_rod'}, {'item': 'tide:stone_fishing_rod'}, {'item':
'tide:iron_fishing_rod'}, {'item': 'tide:golden_fishing_rod'}], 'result':
{'count': 1, 'id': 'tide:crystal_fishing_rod'}, 'template': {'tag': 'c:strings',
'__resolved': True}, 'id': fishcasting:crystal_casting_rod_smithing,
'resource_dir': PathResourceDir(external=False, reexport=True, required=True,
path=PosixPath('/home/runner/work/fishcasting/fishcasting/doc/../src/common/main
/resources'), archive=False), '__resolved': True}
Tag: type=minecraft:smithing_transform [type=TaggedUnionMatchErrorGroup,
input_value={'type': 'minecraft:smith...urces'), archive=False)},
input_type=dict]
recipe.SmithingRecipe.SmithingTransformRecipe
ValidationError: 5 validation errors for SmithingTransformRecipe
base
Input should be a valid dictionary or instance of ItemIngredient
[type=model_type, input_value=[{'item':
'minecraft:fish...de:golden_fishing_rod'}], input_type=list]
For further information visit https://errors.pydantic.dev/2.13/v/model_type
result.function-after[_set_name(),
function-wrap[_wrap_root_load_from_id()]].item
Field required [type=missing, input_value={'count': 1, 'id':
'tide:crystal_fishing_rod'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.13/v/missing
result.function-after[_set_name(),
function-wrap[_wrap_root_load_from_id()]].count
Extra inputs are not permitted [type=extra_forbidden, input_value=1,
input_type=int]
For further information visit
https://errors.pydantic.dev/2.13/v/extra_forbidden
result.function-after[_set_name(), function-wrap[_wrap_root_load_from_id()]].url
Field required [type=missing, input_value={'count': 1, 'id':
'tide:crystal_fishing_rod'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.13/v/missing
result.function-after[_set_name(),
function-wrap[_wrap_root_load_from_id()]].count
Extra inputs are not permitted [type=extra_forbidden, input_value=1,
input_type=int]
For further information visit
https://errors.pydantic.dev/2.13/v/extra_forbidden [type=TaggedUnionMatchError,
input_value={'type': 'minecraft:smith...urces'), archive=False)},
input_type=dict] [type=TaggedUnionMatchError, input_value={'type':
'patchouli:smith...e.casting_rod.smithing'}, input_type=dict]
Error: Process completed with exit code 1.
- Lingua principale
- Python
- Stelle
- 7
- Fork
- 10
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hexdoc-dev/hexdoc
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
hexdoc-dev/hexdoc#109 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
hexdoc-dev/hexdoc#108 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hexdoc-dev/hexdoc#90 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
hexdoc-dev/hexdoc#106 ·
-
Support Toki PonaAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
hexdoc-dev/hexdoc#105 ·
Tutte le issue di hexdoc-dev/hexdoc
Issue simili
-
wr.dynamodb.read_items returns [{}] for a single partition value that does not existForse già presa @auraseb l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
aws/aws-sdk-pandas#3520 ·
I maintainer di solito rispondono entro 2 giorni
-
requires triage typing
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sqlalchemy/sqlalchemy#13704 ·
I maintainer di solito rispondono entro 1 giorno
-
Edit tool converts CRLF files to LFForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
huggingface/tau#774 ·
I maintainer di solito rispondono entro 1 giorno
-
show ignores the row limit when a column or table name contains "limit"Forse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
What happened to `check.py`?Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
linebender/resvg#1179 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni