File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
main/scala/com/github/swagger/enumeratum/converter
test/scala/com/github/swagger/enumeratum/converter Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ class SwaggerEnumeratumModelConverter extends ModelResolver(Json.mapper()) {
2828 nullSafeList(annotatedType.getCtxAnnotations).foreach {
2929 case p : Parameter => {
3030 noneIfEmpty(p.description).foreach(desc => sp.setDescription(desc))
31- sp.setDeprecated (p.deprecated)
31+ if (p.deprecated) { sp.setDeprecated( true )}
3232 noneIfEmpty(p.example).foreach(ex => sp.setExample(ex))
3333 noneIfEmpty(p.name).foreach(name => sp.setName(name))
3434 }
3535 case s : SchemaAnnotation => {
3636 noneIfEmpty(s.description).foreach(desc => sp.setDescription(desc))
3737 noneIfEmpty(s.defaultValue).foreach(df => sp.setDefault(df))
38- sp.setDeprecated (s.deprecated)
38+ if (s.deprecated) { sp.setDeprecated( true )}
3939 noneIfEmpty(s.example).foreach(ex => sp.setExample(ex))
4040 noneIfEmpty(s.name).foreach(name => sp.setName(name))
4141 Option (s.accessMode).foreach {
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ class ModelPropertyParserTest extends AnyFlatSpec with Matchers with OptionValue
8787 schema.getDescription shouldEqual " An annotated field"
8888 schema.getName shouldEqual " field"
8989 schema.getDefault should be (null )
90+ schema.getDeprecated should be (null )
9091 schema.getEnum.asScala shouldEqual Ctx .Color .values.map(_.entryName)
9192 nullSafeList(model.value.getRequired) shouldBe Seq (" field" )
9293 }
You can’t perform that action at this time.
0 commit comments