tamasfe / aide

An API documentation library
Apache License 2.0
417 stars 70 forks source link

Consistenct issue when calling set_extract_schemas #114

Closed tomas789 closed 8 months ago

tomas789 commented 9 months ago

There is a slight consistency issue. By default extract_schemas is set to true and schema to SchemaSettings::draft07(). When I call set_extract_schemas(true) I'd expect it to kind of do nothing. But it also sets schema to a different value.

self.schema = SchemaGenerator::new(SchemaSettings::draft07().with(|s| {
    s.inline_subschemas = false;
    s.definitions_path = "#/components/schemas/".into();
}));

This leads to a slightly confusing behaviour.

Wicpar commented 8 months ago

Schemas seem to be correct in both cases, you have functions to control generation settings from aide::gen::*