ワンクリックで
add-memos-api-endpoint
Instructions for adding a new API endpoint handling versioning backward compatibility in MemosM.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Instructions for adding a new API endpoint handling versioning backward compatibility in MemosM.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | Add Memos API Endpoint |
| description | Instructions for adding a new API endpoint handling versioning backward compatibility in MemosM. |
When adding a new API endpoint to the MemosM Android client, you must handle the API versioning correctly.
Add the abstract method definition to app/src/main/java/org/example/memosm/api/MemosApi.kt.
This interface acts as the central contract for the app. The methods here should not have Retrofit annotations (like @GET or @POST).
interface MemosApi {
// ...
suspend fun getMyNewData(param1: String): MyNewDataResponse
}
The network requests are executed via Retrofit in the versioned interfaces. The core one is MemosApiV0353.kt (or the latest version file).
Add the Retrofit annotated method there:
interface MemosApiV0353 {
@GET("api/v1/mynewdata")
suspend fun getMyNewData(@Query("param1") param1: String): MyNewDataResponse
}
If the endpoint has a different signature in older API versions, you might need to add/override it in MemosApiV0260.kt or MemosApiV0270.kt.
Each version has an implementation class (e.g., MemosApiV0353Impl.kt) that implements MemosApi and delegates to the Retrofit interface.
class MemosApiV0353Impl(private val api: MemosApiV0353) : MemosApi {
// ...
override suspend fun getMyNewData(param1: String): MyNewDataResponse {
return api.getMyNewData(param1)
}
}
Make sure to implement the method in the older version implementations (MemosApiV0260Impl.kt, etc.) as well, either delegating to the network call or returning a fallback/throwing an exception if the API is unsupported in that old version.