Skip to content

Conversation

@fenpaws
Copy link
Contributor

@fenpaws fenpaws commented Oct 8, 2024

I wanted to generate a base API for Golang with the Swagger you provided, but the generator didn't understand the x-constants. We had to Fix a few things in the documentation to make it work,

  • replaced x-constants with components
  • added missing 200 response for POST request to upload whitelist

- replaced x-components with components
- added missing 200 response for POST request to upload whitelist
- changed known ids/numbers to integers so no float or doubles are created where they are not needed for code generation
…ties

- found more numbers that cn be normal integers
- added more optional properties for the user
The API endpoint allows for getting the user by ID and by their Username.
@DonovanDMC DonovanDMC added the enhancement New feature or request label Oct 11, 2024
@DonovanDMC
Copy link
Owner

I'm going to leave this open for a bit longer since I assume you're implementing things based off of the spec and adding to this pr as you notice issues

@DonovanDMC
Copy link
Owner

DonovanDMC commented Oct 11, 2024

I've approved the workflows to run so linting issues show up, you can run it locally with pnpm run lint:api

@fenpaws
Copy link
Contributor Author

fenpaws commented Nov 22, 2024

I think we are done with the fixes.
We successfully generated a usable Go Library and your linter also run through without a problem.

Also, it should now be more in spec than before, this should increase the compatibly to doc generators. We didn't test it tho.

You should be able to merge it.

fix: make warning type nullable at desired locations and change more numbers to integer
Copy link
Owner

@DonovanDMC DonovanDMC left a comment

Choose a reason for hiding this comment

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

Also some consistency issues, single quotes and quoted properties ("$ref")

@alphyron
Copy link
Contributor

Also some consistency issues, single quotes and quoted properties ("$ref")

I need to say, I don't understand what do you mean by that... I search for lines with "$ref" where the value has single quotes but I can't find any... did you mean something else?

@DonovanDMC
Copy link
Owner

DonovanDMC commented Nov 29, 2024

Also some consistency issues, single quotes and quoted properties ("$ref")

I need to say, I don't understand what do you mean by that... I search for lines with "$ref" where the value has single quotes but I can't find any... did you mean something else?

They don't need quotes at all, no properties should the quoted unless they need to be

@alphyron
Copy link
Contributor

Also, a while ago, we had the idea it would be interesting to have something like a test user at e621 with that we can execute some integration tests. Something like an additional validation task.
Of course there are some endpoints you cannot test like the admin or moderation stuff but the most used things like posts, user, faves and so on could be checked.
What are your thoughts about it?

@DonovanDMC
Copy link
Owner

Also, a while ago, we had the idea it would be interesting to have something like a test user at e621 with that we can execute some integration tests. Something like an additional validation task. Of course there are some endpoints you cannot test like the admin or moderation stuff but the most used things like posts, user, faves and so on could be checked. What are your thoughts about it?

It's trivial to run an instance of e621ng on your own

@alphyron
Copy link
Contributor

alphyron commented Dec 3, 2024

Also, a while ago, we had the idea it would be interesting to have something like a test user at e621 with that we can execute some integration tests. Something like an additional validation task. Of course there are some endpoints you cannot test like the admin or moderation stuff but the most used things like posts, user, faves and so on could be checked. What are your thoughts about it?

It's trivial to run an instance of e621ng on your own

Yeah is a point.

Except of that... Are there any other open points I should fix?

alphyron and others added 5 commits January 6, 2025 16:19
- removed date-time format:  e621 sends more data then the format can hold
- fixed default_image_size typo
- api_regen_multiplier type to be a integer
@fenpaws
Copy link
Contributor Author

fenpaws commented Jul 13, 2025

Heya, we just did a huge refactor of the API, or rather how it's generated. All tests passed.

@fenpaws fenpaws requested a review from DonovanDMC July 13, 2025 17:07
@DonovanDMC
Copy link
Owner

DonovanDMC commented Jul 13, 2025

I'm going to assume this has been tested further beyond the linting passing, and that I don't need to spend several hours pouring over every detail?

@fenpaws
Copy link
Contributor Author

fenpaws commented Jul 13, 2025

yeah i did :D It's basically just an extraction of the main OpenAPI you wrote with some fixes.

@DonovanDMC DonovanDMC merged commit d5a5b6f into DonovanDMC:master Jul 13, 2025
2 checks passed
@DonovanDMC
Copy link
Owner

It's failing to load, and the error in the console is completely incomprehensible

@alphyron
Copy link
Contributor

Intresting, because the finals openapi not changed alot, but yeah you are right. I can reproduce the error, when I run it local. I will check it.

@DonovanDMC
Copy link
Owner

Seems likely to be a version mismatch in some dependency, my local repository which had not been updated with the dependency changes was able to run the webpack dev just fine, but when installing the newer dependencies it started showing the same issue seen in prod

@alphyron
Copy link
Contributor

alphyron commented Jul 13, 2025

so, webpack in the new version doesn't works? then whioch method you would prefer to fix this problems? reverting dependencies to the old method or creating a new one for the ui?

@fenpaws
Copy link
Contributor Author

fenpaws commented Jul 13, 2025

As stupid as it sounds, but it works on my machine. I cleaned all my NPM caches and did a clean pnpm i then running pnpm run build:production && pnpm run start. And i don't get any errors, it also opens perfectly fine.
image

@DonovanDMC
Copy link
Owner

So it works fine with pnpm but it shits the bed without it
sigh I guess I'll bring back pnpm, seems like we're stuck with it because its version resolution is different in a way that works

@DonovanDMC
Copy link
Owner

It indeed does work with pnpm, so looks like we're stuck with that
I really hate getting locked into a package manager like this but I'm not spending hours trying to figure out what's different about their dependency resolution that's making it work

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.

4 participants