Skip to content

Generator scripts for converting OpenAPI specs to models #157

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

Merged
merged 1 commit into from
May 29, 2025

Conversation

ToshY
Copy link
Owner

@ToshY ToshY commented May 29, 2025

As I have denoted before in some issues/PRs, is that API is updated from time-to-time, and it's a bit of a hassle to manually check the reference documentation and figure it out if an endpoint was updated.

I've asked Bunny.net support and they denoted they had OpenAPI specs available (all this time I didn't know it was publicly available). In order to keep track of any changes made to the specifications, I've also created an additional repository ToshY/bunnynet-openapi-specification. This will check daily on any changes in the specs, create a new release when needed, and deploys the (beautified) OpenAPI specs to GitHub Pages, which can be found through the manifest file: https://toshy.github.io/bunnynet-openapi-specification/manifest.json.

With the above ready, I've started with creating the generator in order to try and automatically update/add models based on the OpenAPI specs. So I've several AI tools to "try" and make my life easier, and by doing this I realised that generated code becomes very hard to follow/understand when the requirements became more complex. In an attempt to refactor a majority of the (generated) code, I've kept the ModelBodyMethodGenerator mostly intact (as generated AI code) with some very minor tweeks, because in it's current state it works like intended: it generates the models body methods that are with the same structure as existing models (which is desired).


TLDR

  • Created generator CLI commands for creating/updating mappings and models based on latest OpenAPI specs.
  • Generator scripts are run weekly (cron, sundays) using Github Actions and can create PRs when needed.
  • Removed (unofficial) SetThumbnailByBody due to incompatible with OpenAPI specs; reverts [Feature]: Stream API Upload Thumbnail #96

@ToshY ToshY added the enhancement New feature or request label May 29, 2025
Copy link
Owner Author

@ToshY ToshY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ToshY ToshY self-assigned this May 29, 2025
@ToshY ToshY merged commit 12efdf9 into master May 29, 2025
20 checks passed
@ToshY ToshY deleted the feature/generator branch May 29, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant