Charles Treatman 6e137bb61d
Add sample spec to catch external file reference issues in swagger-parser (#17773)
* add a sample that catches swagger-parser issues with external refs

* generate samples for new test spec
2024-02-06 16:22:41 +08:00

2.9 KiB

\AuthAPI

All URIs are relative to http://localhost:3000

Method HTTP request Description
TestAuthHttpBasic Post /auth/http/basic To test HTTP basic authentication
TestAuthHttpBearer Post /auth/http/bearer To test HTTP bearer authentication

TestAuthHttpBasic

string TestAuthHttpBasic(ctx).Execute()

To test HTTP basic authentication

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AuthAPI.TestAuthHttpBasic(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBasic``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `TestAuthHttpBasic`: string
	fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBasic`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiTestAuthHttpBasicRequest struct via the builder pattern

Return type

string

Authorization

http_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestAuthHttpBearer

string TestAuthHttpBearer(ctx).Execute()

To test HTTP bearer authentication

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AuthAPI.TestAuthHttpBearer(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBearer``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `TestAuthHttpBearer`: string
	fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBearer`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiTestAuthHttpBearerRequest struct via the builder pattern

Return type

string

Authorization

http_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

[Back to top] [Back to API list] [Back to Model list] [Back to README]