Open APIs

 View Only
  • 1.  Issue generating java models for TMF 637 Product Inventory using openapi-codegen

    Posted 20 days ago

    Hi All

    We are trying to generate client for the product inventory openapi specification v5 and facing inheritance issues using openapicodegen > spring mode. Anyone in the community has faced the same problem and got any resolution. The particular problem is around the 

    GeographicLocationFVO.java:[93,10] error: incompatible types: AtTypeEnum cannot be converted to String

    GeographicLocation.java:[135,30] error: getAtType() in GeographicLocation cannot override getAtType() in Place

    Note:

    The same GeographicLocation types defined under TMF673 are all compiling fine using openapicodegen. The enum has been corrected in GeographicSite specificaiton while its not corrected in ProductInventory.

    We are using the openapitools plugin to generate the models from yaml specification

    <groupId>org.openapitools</groupId>
    <artifactId>openapi-generator-maven-plugin</artifactId>
    <version>7.16.0</version>
    I have tried with the additional configurationoptions but still the same issue
    <useOneOfInterfaces>false</useOneOfInterfaces>
    <legacyDiscriminatorBehavior>true</legacyDiscriminatorBehavior>

    Is there any plans to align the inheritance issue caused in productInventory, productOrder openapi v5 specifications ?



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


  • 2.  RE: Issue generating java models for TMF 637 Product Inventory using openapi-codegen

    Posted 15 days ago

    Hi,

    I was looking at this briefly as well and I am sorry to say I haven't solved it either (different errors at the moment tough). I assume it is a matter of resolving dependencies with correct versions and the plugin settings etc.

    Is it a web page available that details the necessary maven setup in order to generate this model?

    regards,

    Rune Gellein

    BT plc



    ------------------------------
    Rune Gellein
    BT Group plc
    ------------------------------



  • 3.  RE: Issue generating java models for TMF 637 Product Inventory using openapi-codegen

    Posted 15 days ago

    Hi,

    I am using the below dependencies and generate it. It is working fine without any modifications

    <dependencies>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter</artifactId>
    </dependency>
     
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
    </dependency>
        <!-- Spring Boot Web (REST APIs) -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
     
        <!-- Validation (for @Valid, @NotNull etc.) -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
     
        <!-- Jackson (JSON handling - usually included, but explicit is safe) -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
     
        <!-- YAML support -->
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
        </dependency>
     
        <!-- OpenAPI UI (to test APIs in browser) -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>2.5.0</version>
        </dependency>
     
        <!-- Lombok (optional but useful for POJOs) -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
     
     
    </dependencies>



    ------------------------------
    Kumaresan Palanisamy
    OMANTEL
    ------------------------------