Skip to content

Commit

Permalink
feat(core): remove SwaggerSchemaPostProcessor (replaced by SwaggerSch…
Browse files Browse the repository at this point in the history
…emaUtil)
  • Loading branch information
timonback committed Feb 2, 2024
1 parent 7a7dd88 commit 2e4f426
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.github.stavshamir.springwolf.schemas.postprocessor.AvroSchemaPostProcessor;
import io.github.stavshamir.springwolf.schemas.postprocessor.ExampleGeneratorPostProcessor;
import io.github.stavshamir.springwolf.schemas.postprocessor.SchemasPostProcessor;
import io.github.stavshamir.springwolf.schemas.postprocessor.SwaggerSchemaPostProcessor;
import io.swagger.v3.core.converter.ModelConverter;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
Expand Down Expand Up @@ -118,13 +117,6 @@ public ExampleGeneratorPostProcessor exampleGeneratorPostProcessor(ExampleGenera
return new ExampleGeneratorPostProcessor(exampleGenerator);
}

@Bean
@ConditionalOnMissingBean
@Order(100)
public SwaggerSchemaPostProcessor swaggerSchemaPostProcessor() {
return new SwaggerSchemaPostProcessor();
}

@Bean
@ConditionalOnMissingBean
public ExampleGenerator exampleGenerator() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import io.github.stavshamir.springwolf.schemas.example.ExampleJsonGenerator;
import io.github.stavshamir.springwolf.schemas.postprocessor.ExampleGeneratorPostProcessor;
import io.github.stavshamir.springwolf.schemas.postprocessor.SchemasPostProcessor;
import io.github.stavshamir.springwolf.schemas.postprocessor.SwaggerSchemaPostProcessor;
import io.swagger.v3.core.util.Json;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
Expand Down Expand Up @@ -42,10 +41,7 @@ class DefaultSchemasServiceTest {
private final SchemasPostProcessor schemasPostProcessor = Mockito.mock(SchemasPostProcessor.class);
private final ComponentsService componentsService = new DefaultComponentsService(
List.of(),
List.of(
new ExampleGeneratorPostProcessor(new ExampleJsonGenerator()),
schemasPostProcessor,
new SwaggerSchemaPostProcessor()),
List.of(new ExampleGeneratorPostProcessor(new ExampleJsonGenerator()), schemasPostProcessor),
new SwaggerSchemaUtil(),
new SpringwolfConfigProperties());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@
}
},
"nmfm" : {
"type" : "object"
"type" : "object",
"additionalProperties" : {
"$ref" : "#/components/schemas/MyClass"
}
},
"ns" : {
"type" : "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,20 @@
"description" : "Map with example",
"examples" : [ {
"key1" : "value1"
} ]
} ],
"additionalProperties" : {
"type" : "string",
"description" : "Map with example",
"examples" : [ "{\"key1\":\"value1\"}" ]
}
},
"mss_plain" : {
"type" : "object",
"description" : "Map without example"
"description" : "Map without example",
"additionalProperties" : {
"type" : "string",
"description" : "Map without example"
}
},
"s" : {
"type" : "string",
Expand Down

0 comments on commit 2e4f426

Please sign in to comment.