Open APIs

 View Only
Expand all | Collapse all

openapicodegen fails to generate valid models for v5 specification for spring

  • 1.  openapicodegen fails to generate valid models for v5 specification for spring

    TM Forum Member
    Posted Oct 11, 2025 08:24

    Hi All

    Did anyone face a problem in generating the server side skeleton for spring-boot language (V2 or v3) for the latest v5 OpenAPI specification ?

    To be more specific, the problem is around the @type discriminator for PlaceFVO which inturn impacts wherever we use GeographicXXXX definitions. 

    We are using org.openapitools.openapi-generator-maven-plugin plugin to generate server side code for spring language. 

    Issues observed

    getAtType() in com.example.model.GeographicLocationMVO cannot implement getAtType() in com.example.model.GeographicLocationRefOrValueMVO
    getAtType() in com.example.model.GeographicLocationFVO cannot implement getAtType() in com.example.model.GeographicLocationRefOrValueFVO

    Tried providing typeMapping in the build configuration, but still facing this problem.

    Thanks,
    Raghavan



    ------------------------------
    Raghavan TV
    Tata Consultancy Services
    ------------------------------


  • 2.  RE: openapicodegen fails to generate valid models for v5 specification for spring

    TM Forum Member
    Posted Oct 11, 2025 13:29
    Edited by Raghavan TV Oct 11, 2025 13:29

    Ok. Found the root cause for this issue. 

    The problem was with TMF622-ProductOrdering-v5.0.0.oas.yaml with the GeographicAddress schemas

    This has been corrected in the latest TMF673-GeographicAddress-v5.0.0.oas schemas. So manually synced the GeoXXXX schemas inside ProductOrdering based on TMF673-GeographicAddress-v5.0.0.oas definitions and then the codegen works fine.

    I'll open a Jira ticket for the same.

     



    ------------------------------
    Raghavan TV
    Tata Consultancy Services
    ------------------------------