pub struct ApiConfig {
    pub server_url: String,
    pub default_api_server: String,
    pub api_key_name: String,
    pub api_key_location: ApiKeyLocation,
    pub api_key_value: String,
    pub fetch_credentials: FetchCredentials,
}
Expand description

Used to configure api access.

Fields

server_url: String

OpenAPI spec has a provision for providing the server url. The UI will list all the server URLs provided in the spec. The user can then select one URL to which he or she intends to send API calls while trying out the apis. However, if you want to provide an API server of your own which is not listed in the spec, you can use this property to provide one. It is helpful in the cases where the same spec is shared between multiple environment say Dev and Test and each have their own API server.

default_api_server: String

If you have multiple api-server listed in the spec, use this attribute to select the default API server, where all the API calls will goto. This can be changed later from the UI.

api_key_name: String

Name of the API key that will be send while trying out the APIs.

The default is “Authorization”.

api_key_location: ApiKeyLocation

Determines how you want to send the api-key.

The default is ApiKeyLocation::Header.

api_key_value: String

Value of the API key that will be send while trying out the APIs. This can also be provided/overwritten from UI.

fetch_credentials: FetchCredentials

Enables passing credentials/cookies in cross domain calls, as defined in the Fetch standard, in CORS requests that are sent by the browser.

The default is FetchCredentials::SameOrigin.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a collection.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more