Skip to content

breaking change in ModelResolver (2.2.29) - protected method addRequiredItem #4860

@pjfanning

Description

@pjfanning

This change: 4b76256#diff-bed6aab5e29942b1a575bded333604f9dfaeb2ef9475f1433266ece4e49f4fcbR3218

Change from protected void addRequiredItem to protected boolean addRequiredItem.

Example build failure:
https://github.com/swagger-akka-http/swagger-enumeratum-module/actions/runs/13796686681/job/38589885175?pr=98

[error] java.lang.NoSuchMethodError: com.github.swagger.scala.converter.SwaggerScalaModelConverter.addRequiredItem(Lio/swagger/v3/oas/models/media/Schema;Ljava/lang/String;)V
[error] 	at com.github.swagger.scala.converter.SwaggerScalaModelConverter.protected$addRequiredItem(SwaggerScalaModelConverter.scala:301)
[error] 	at com.github.swagger.scala.converter.SwaggerScalaModelConverter.$anonfun$scalaClassSchema$2(SwaggerScalaModelConverter.scala:301)

com.github.swagger.scala.converter.SwaggerScalaModelConverter extends ModelResolver

The change in ModelResolver is source compatible - ie existing code that extends ModelResolver will compile with the new jar.

If you have a class compiled against swagger-core 2.2.28, then if you update the swagger-core jar to 2.2.29 but don't recompile but just run with the existing pre-compiled class you will get the NoSuchMethodError above.

I guess at this stage, the aim would be to keep the breaking code change. Would it be possible to confirm this? I can fix the issue by releasing new versions of my jars that are built with 2.2.29. I just don't want to have to do another release if the change is reverted in a subsequent release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions