Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generated catalogue models #19

Merged
merged 4 commits into from
Jun 28, 2024
Merged

Conversation

michpohl
Copy link
Contributor

@michpohl michpohl commented Jun 20, 2024

This adds generated catalogue code made using openapi-generator-clifrom our catalog API endpoint definitions.
Only the generated models have been added so far. Generated helper class have issues with maitaining compatibility with Android SDKs <26, so I left them out for now.

This is a temporary version intended for prototyping. It will be subject to change.
The generated code has a few small issues, but if you're looking to use just the types, you'll be fine.

This also adds catalogue-openapi.json, our current state of the ASPI definition,
and openapi-config.yml, specifying the generator-specific args used for generation.
This was the actual command used, from SDK root:

openapi-generator generate -i catalogue/catalogue_openapi.json -g kotlin -o ./catalogue/ -c catalogue/openapi-config/openapi-config.yml

This will also not be released in a public package yet - some improvements need to be made for a first "official" release.
If you have trouble creating a local release to work with this hit me up, and I'll show you how.

@michpohl michpohl requested review from stefanmoro and a team June 20, 2024 05:27
CanYumusak
CanYumusak previously approved these changes Jun 20, 2024
catalog/build.gradle.kts Outdated Show resolved Hide resolved
catalog/proguard-rules.pro Outdated Show resolved Hide resolved
catalog/proguard-rules.pro Outdated Show resolved Hide resolved
@stefanmoro
Copy link
Member

stefanmoro commented Jun 20, 2024

Rename to catalogue please :) We follow the same naming as the corresponding API domain: https://developer.tidal.com/reference/web-api?spec=catalogue-v2&ref=get-albums-v2

@michpohl
Copy link
Contributor Author

Rename to catalogue please :) We follow the same naming as the corresponding API domain: https://developer.tidal.com/reference/web-api?spec=catalogue-v2&ref=get-albums-v2

Will do! This info came after the modules had been created and I will fix the naming in a separate PR for both iOS and Android! Good?

@michpohl michpohl force-pushed the michael/Add-generated-catalog-models branch 2 times, most recently from 731b0d2 to f3fff09 Compare June 20, 2024 12:10
@michpohl michpohl changed the title Michael/add generated catalog models Add generated catalog models Jun 20, 2024
@michpohl michpohl requested a review from CanYumusak June 20, 2024 12:10
CanYumusak
CanYumusak previously approved these changes Jun 20, 2024
@michpohl
Copy link
Contributor Author

michpohl commented Jun 21, 2024

Ok, so I'm not merging this for now. The reason:
openapi-generator doesn't honor the compatibility to API 25 and below, even when the setting is on. Looks like the developers forgot a few classes to cover here...

As you can see above, lint points this out - and initially I wanted to just override this, but since no one uses this yet, I will first do another look at what I can do about it.

@michpohl michpohl force-pushed the michael/Add-generated-catalog-models branch from f3fff09 to 9a90659 Compare June 28, 2024 08:22
@michpohl michpohl requested a review from CanYumusak June 28, 2024 08:22
@michpohl
Copy link
Contributor Author

@CanYumusak I found issues with the generator and therefore opted to only push the models for now (as is requested)

@michpohl michpohl enabled auto-merge June 28, 2024 08:23
@michpohl michpohl marked this pull request as draft June 28, 2024 08:39
auto-merge was automatically disabled June 28, 2024 08:39

Pull request was converted to draft

@michpohl michpohl force-pushed the michael/Add-generated-catalog-models branch from 9a90659 to e13e576 Compare June 28, 2024 12:52
@michpohl michpohl force-pushed the michael/Add-generated-catalog-models branch from e13e576 to 3e30d61 Compare June 28, 2024 13:06
@michpohl michpohl force-pushed the michael/Add-generated-catalog-models branch from 3e30d61 to 5df8ea7 Compare June 28, 2024 13:24
@michpohl michpohl marked this pull request as ready for review June 28, 2024 13:25
@michpohl michpohl enabled auto-merge June 28, 2024 13:29
@michpohl michpohl changed the title Add generated catalog models Add generated catalogue models Jun 28, 2024
@michpohl michpohl added this pull request to the merge queue Jun 28, 2024
Merged via the queue into main with commit a587143 Jun 28, 2024
7 checks passed
@michpohl michpohl deleted the michael/Add-generated-catalog-models branch June 28, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants