You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As @CasperWA has pointed out, "type" does not appear as a required key for StructureResource and also LinksResource in the generated specification, because they are specified as constant fields in our models. The suggestion is to switch from Field("structures", const=True, ...) to e.g. constr(regex='^structures$'), and at the same time, we could contribute back to pydantic with a schema representation for the const string; StackOverflow suggests an enum with only one value.
Furthermore, I found that type is not listed as "required" for a StructureResource. Also, the constant value of "structures" is not provided in the specification. We could force this through the pattern property, e.g.? I even think this should be contributed upstream to FastAPI.
As @CasperWA has pointed out, "type" does not appear as a required key for
StructureResource
and alsoLinksResource
in the generated specification, because they are specified as constant fields in our models. The suggestion is to switch fromField("structures", const=True, ...)
to e.g.constr(regex='^structures$')
, and at the same time, we could contribute back to pydantic with a schema representation for the const string; StackOverflow suggests an enum with only one value.Originally posted by @CasperWA in #477 (comment)
The text was updated successfully, but these errors were encountered: