PaddleHQ / paddle-openapi

An OpenAPI description for the Paddle API.
https://developer.paddle.com/api-reference/overview
Apache License 2.0
8 stars 0 forks source link

[Bug]: Generation fails with spec issues #5

Open Haarolean opened 2 months ago

Haarolean commented 2 months ago

What happened?

Some parts of the contract contain invalid spec syntax, like this one: https://github.com/PaddleHQ/paddle-openapi/blob/main/v1/openapi.yaml#L4170

There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 4, Warning count: 42
Errors: 
    -attribute paths.'/reports'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/customers/{customer_id}/credit-balances'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/customers/{customer_id}'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/discounts'(get).parameters.[['unknown']].in is missing
Warnings: 
    -attribute paths.'/reports'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/customers/{customer_id}/credit-balances'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/customers/{customer_id}'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/discounts'(get).parameters.[['unknown']].in is missing

Steps to reproduce

  1. build via openapi-generator
  2. profit

What did you expect to happen?

to get a bunch of generated classes

Logs

org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 4, Warning count: 42
Errors: 
    -attribute paths.'/reports'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/customers/{customer_id}/credit-balances'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/customers/{customer_id}'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/discounts'(get).parameters.[['unknown']].in is missing
Warnings: 
    -attribute paths.'/reports'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/customers/{customer_id}/credit-balances'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/customers/{customer_id}'(get).parameters.[['unknown']].in is missing
    -attribute paths.'/discounts'(get).parameters.[['unknown']].in is missing
vijayasingam-paddle commented 2 months ago

Hi @Haarolean, Thank you for raising this issue to us. I am sorry about this issue. Upon analysis, I can see that one of our script is not working well and are leaving empty objects {} behind.

I will let you know once this issue is fixed.

Thank you.

dvrfluxchat commented 2 months ago

hey @vijayasingam-paddle , any idea when this will be done? I am using cloudflare pages to deploy my nextjs app but that is not supported because of some edge runtime issues. I want to create a typesafe client but all the codegen tools are breaking with this openapi spec. would really appreciate any timeline here

vijayasingam-paddle commented 2 months ago

Hello 👋 Sorry for not providing an update to this thread for a while.

We did fix the issue with empty objects({}) but then realized that the openapi-generator was still not happy due to x-enum-descriptions and some other issues with oneOf

We are trying to find the best way to fix the other issues we encountered. I will let you know once I can successfully generate an SDK.

@dvrfluxchat, I'm sorry that you had to generate your types manually due to an issue with our Node SDK. Both issues should be fixed in the next few weeks. However, I recommend using our Node SDK instead of generating types as we can't guarantee how accurate they will be.

Thank you.

dvrfluxchat commented 1 month ago

Node SDK does not work in edge environment because of the node:crypto module being used in few places, for now i forked the sdk and removed the dependencies and it works fine in edge.