Closed
Description
概要
OpenAPI generator の更新により、エンドポイントの設定が apiClient だけでなく axios でもできるようになり、axiosの設定値が最も優先順位が高くなった。
OpenAPITools/openapi-generator#17296
そのため OpenAPI generator の有無にかかわらず axios でエンドポイントの設定ができるようになるため、axios に統一したい。
詳細
以下のように修正する。
/** api-client の共通の Configuration があればここに定義します。 */
function createConfig(): apiClient.Configuration {
const config = new apiClient.Configuration({
- basePath: import.meta.env.VITE_AXIOS_BASE_ENDPOINT_ORIGIN,
});
return config;
}
/** axios の共通の設定があればここに定義します。 */
const axiosInstance = axios.create({
+ baseURL: import.meta.env.VITE_AXIOS_BASE_ENDPOINT_ORIGIN,
headers: {
'Content-Type': 'application/json',
},
withCredentials: true,
});
影響範囲
- https://maris.alesinfiny.org/guidebooks/how-to-develop/vue-js/project-settings/#vite-settings
API エンドポイントを設定する際の注意点 で設定箇所が baseURL だけになる - https://maris.alesinfiny.org/guidebooks/how-to-develop/publication/#api-endpoint-settings
OpenAPI generator の利用の有無にかかわらず axios で設定 になる
完了条件
- エンドポイントの設定が axios で行われている
- Dressca
- AzureADB2C
- エンドポイントの設定に関するドキュメントが正しく更新されている