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
While using aide I'd like to change schemars' settings, specifically I'd like to disable making Options being turned into anyOfs with nulls. Schemars supports this by setting option_nullable = true and option_add_null_type = false on its settings struct which I can do by doing something like this:
But if I want to use other aide features such as schema extraction then this isn't going to work because that also modifies the schema generator. I worked around this for now by just looking at the source and making the same modifications on the schema settings as extract_schemas does, but this is not optimal as it requires me to know internals of aide. Would you consider exposing these settings through aide so this is not required?
The text was updated successfully, but these errors were encountered:
After some brief thinking I believe your approach is the way to go here. By default aide aims to conform to the OpenAPI spec during schema generation with sensible defaults. If you need to alter this in any way and you know what you're looking for, the schema generator is exposed and it's possible to do so.
I would rather not expose individual features of schemars one by one. The extract_schemas setting is an exception; I exposed it as a high-level switch because it's a behaviour people generally expect from doc generators but is disabled by default because schemars doesn't handle name conflicts.
While using aide I'd like to change schemars' settings, specifically I'd like to disable making
Option
s being turned intoanyOf
s with nulls. Schemars supports this by settingoption_nullable = true
andoption_add_null_type = false
on its settings struct which I can do by doing something like this:But if I want to use other aide features such as schema extraction then this isn't going to work because that also modifies the schema generator. I worked around this for now by just looking at the source and making the same modifications on the schema settings as
extract_schemas
does, but this is not optimal as it requires me to know internals of aide. Would you consider exposing these settings through aide so this is not required?The text was updated successfully, but these errors were encountered: