AlgebraicJulia / AlgebraicJulia/ACSets.jl

JSON Schema only use `$def` for selected types, need better way to reference other files

未关闭
#105 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
intertype intertypes
主要语言
Julia
星标
36
派生
11
PR 合并指标
30 天内没有已合并 PR

描述

If I validate an object against a JSON Schema, it will check all `$def`s. This behavior ends up being too permissive since some types will be objects with arbitrary fields due to the `Object` InterType. This means nearly _any_ JSON will validate against it which defeats the purpose of a JSON Schema.

A solution to this may be just selecting the InterTypes you want for the JSON Schema using its specific `generate_module` method's kwargs:
```
generate_module(mod, JSONTarget; exposed_intertypes=[:SomeType, :AnotherType])
```

Note that this isn't a problem with Pydantic since the constructor is called explicitly.

(Encountered this problem when reviewing [this PR](https://github.com/AlgebraicJulia/ACSets.jl/pull/96))

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。