A sample VocaDB API Java Client that is auto-generated by OpenAPI and is auto-fixed by my VocaDB OpenAPI Java Client Autofixer
The original README file coming from this auto-generated client is in README Original.md
This client is generated by:
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
--api-package mikufan.cx.vocadbapiclient.api \
--model-package mikufan.cx.vocadbapiclient.model \
--invoker-package mikufan.cx.vocadbapiclient.client \
-i /local/openapi.json \
--group-id mikufan.cx \
--artifact-id vocadb-api-client \
--artifact-version 1.0.0 \
--minimal-update \
-g java \
-p java8=true \
-p dateLibrary=java8-localdatetime \
-p useRuntimeException=true \
-p useJakartaEe=true \
-p openApiNullable=false \
-p serializationLibrary=jackson \
-p licenseName=WTFPL \
-p licenseUrl=http://www.wtfpl.net/ \
--library resttemplate \
-o /local/sample-unfixed-client
Refer to jitpack to see how to import
Please read VocaDB API Usage Rules before using this API client.
Refer to the generated documentation for how to use this client
- Highly recommended to set your custom User-Agent in
ApiClient
for VocaDB to identity you - This client probably won't work well for any non-GET requests. Base on VocaDB document, you need to set some custom header to be able to use it. This probably can be done by tunning the
RestTemplate
instance insideApiClient
- Take a look of your client, understand the structure
- api directory is where you use to call the VocaDB Rest API
ApiClient
is the core class
- By default, the base URL is always
http://localhost
, change it tohttps://vocadb.net
by callingsetBaseurl()
onApiClient
class- for Java 11 native HTTP client, use
setHostname("vocadb.net")
andsetScheme("https")
(Java 11 native HTTP client doesn't havesetBaseurl()
). If you don't dosetScheme("https")
, you need to manually addbuilder.followRedirects(Redirect.NORMAL)
- for Java 11 native HTTP client, use
- Because VocaDB and UtaiteDB use the same codebase, you could probably change the base URL to
https://utaitedb.net
to make your client an UtaiteDB Api Client. - Test cases are all
@Ignored
when generated by OpenAPI. To run some of them, explicitly remove the@Ignored
and run it at your own risk (e.g. IP banned by VocaDB)