Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][typescript-fetch] "<" and ">" are getting rendered as &lt; and &gt; in GenericItemResponse.ts #11601

Open
denimamab opened this issue Feb 13, 2022 · 7 comments

Comments

@denimamab
Copy link

denimamab commented Feb 13, 2022

Description
"<" and ">" are getting rendered as &lt; and &gt; in GenericResponseItem

openapi-generator version
5.3.1

Command line used for generation
-g typescript-fetch
additionalProperties=typescriptThreePlus=true,prefixParameterInterfaces=true

Example of generated GenericItemResponse.ts :

export interface GenericItemResponse {
    /**
     * 
     * @type {Array<MyType1> | Array<MyType2>}
     * @memberof GenericItemResponse
     */
    items: Array<MyType1> | Array<MyType2> | null;
    /**
     * 
     * @type {number}
     * @memberof GenericItemResponse
     */
    size: number;
}

export function GenericItemResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GenericItemResponse {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'items': Array&lt;MyType1&gt; | Array&lt;MyType2&gt;FromJSON(json['items']),
        'size': json['size'],
    };
}
@NickUfer
Copy link
Contributor

Same problem for the java generator

@jagpreetsinghsasan
Copy link

Same problem with java generator

@wing328
Copy link
Member

wing328 commented Jan 4, 2024

for the issue with the java generator, can you please share a spec to reproduce the issue and also tell us which Java generator(s) did you use?

@Haarolean
Copy link

Haarolean commented Jan 4, 2024

@wing328 hijacking the thread, but compiling something like github's official OpenAPI specification would fail miserably with the java generator with many issues, including the one this issue is about.
Github API spec: https://github.com/github/rest-api-description

@jagpreetsinghsasan
Copy link

for the issue with the java generator, can you please share a spec to reproduce the issue and also tell us which Java generator(s) did you use?

Sure.
Running javacodegen on this openapi spec file: https://github.com/hyperledger/cacti/blob/main/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json doesnt render < and > in some places

Using this cmd to generate the java code
openapi-generator-cli generate -i openapi.json -g java -o generated/openapi/java-client/ --reserved-words-mappings protected=protected --additional-properties hideGenerationTimestamp=true,artifactVersion=1 --ignore-file-override ../../openapi-generator-ignore
openapi version: 6.6.0

@wing328
Copy link
Member

wing328 commented Jan 5, 2024

@jagpreetsinghsasan tested with the latest master and I don't see any compilation issus in the output (java client). Here is the command:

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i https://raw.githubusercontent.com/hyperledger/cacti/main/packages/cactus-plugin-ledger-connector-besu/src/main/json/openapi.json -o /tmp/java23/

can you try again with the latest master or stable release (v7.2.0) ?

@wing328
Copy link
Member

wing328 commented Jan 5, 2024

@Haarolean thanks for letting us know. please kindly open a separate issue to track it with the details instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants