William Cheng 8386a6eaaf
[java] improve petstore tests with openapi v3 spec (#16447)
* regenerate tests in jersey2-java8 client

* update samples

* fix java google api client tests

* update java resteasy to use v3 spec for tests

* update java vertx to test with v3 spec

* update java resttemplate to test with v3 spec

* add new files

* regenerate jersey1 tests
2023-08-30 12:33:01 +08:00

1.7 KiB

DefaultApi

All URIs are relative to http://petstore.swagger.io:80/v2

Method HTTP request Description
fooGet GET /foo

fooGet

FooGetDefaultResponse fooGet()

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.DefaultApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("http://petstore.swagger.io:80/v2");

        DefaultApi apiInstance = new DefaultApi(defaultClient);
        try {
            FooGetDefaultResponse result = apiInstance.fooGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#fooGet");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

FooGetDefaultResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
0 response -