Datasets:
CrossSWE-Bench / instances /api-openapi-generator-24539 /tests /files /IndependentProxyGeneratorTest.java
Download instances/api-openapi-generator-24539/tests/files/IndependentProxyGeneratorTest.java from CrossSWE/CrossSWE-Bench: direct link, hf CLI and curl.
- Browser
- Download file 982 Bytes
-
https://huggingface.co/datasets/CrossSWE/CrossSWE-Bench/resolve/main/instances/api-openapi-generator-24539/tests/files/IndependentProxyGeneratorTest.java
- Command line
-
hf download hf://datasets/CrossSWE/CrossSWE-Bench/instances/api-openapi-generator-24539/tests/files/IndependentProxyGeneratorTest.java
-
curl -L -o IndependentProxyGeneratorTest.java https://huggingface.co/datasets/CrossSWE/CrossSWE-Bench/resolve/main/instances/api-openapi-generator-24539/tests/files/IndependentProxyGeneratorTest.java
982 Bytes
| package org.openapitools.codegen.python; | |
| import org.openapitools.codegen.DefaultGenerator; | |
| import org.openapitools.codegen.config.CodegenConfigurator; | |
| import org.testng.annotations.Test; | |
| public class IndependentProxyGeneratorTest { | |
| public void produceNativeClients() { | |
| String root = System.getenv("PROXY_CONTRACT_OUTPUT"); | |
| for (String mode : new String[]{"independent", "legacy"}) { | |
| CodegenConfigurator cfg = new CodegenConfigurator() | |
| .setGeneratorName(mode.equals("pydantic_v1") ? "python-pydantic-v1" : "python") | |
| .setInputSpec(System.getenv("PROXY_CONTRACT_ROOT") + "/proxy-api.yaml") | |
| .setOutputDir(root + "/generated/" + mode) | |
| .addAdditionalProperty("packageName", "proxy_" + mode) | |
| .addAdditionalProperty("useIndependentImplicitClients", mode.equals("independent")); | |
| new DefaultGenerator().opts(cfg.toClientOptInput()).generate(); | |
| } | |
| } | |
| } | |