ms32035 / firefly-iii-client

Python client for Firefly III API. Please read .generator/Readme.md
22 stars 10 forks source link

bump to api v2.0.4? #17

Closed blathers123 closed 1 year ago

blathers123 commented 1 year ago

Hello,

Would it be possible to update this library to match the latest v2 of the API?

ms32035 commented 1 year ago

Will get to it over the weekend

ms32035 commented 1 year ago

@blathers123 I gave it a try, but there's an issue with the spec:

Errors:
        -attribute components.schemas.RecurrenceTransactionUpdate.required is not of type `array`
Warnings:
        -attribute components.schemas.RecurrenceTransactionUpdate.required is not of type `array`

        at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:620)
        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:647)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:479)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)

This happens quite often. Best you refer to @jc5

JC5 commented 1 year ago

Mmm, what am I looking at, exactly? The RecurrenceTransactionUpdate does not have field required.

ms32035 commented 1 year ago

@JC5 it's not a field, it's an attribute https://api-docs.firefly-iii.org/firefly-iii-2.0.4-v1.yaml line 17019 Something like this is missing

    RecurrenceTransactionStore:
      type: object
      required:
        - description
        - amount
        - source_id
        - destination_id

Maybe an empty array is needed where no fields are required

JC5 commented 1 year ago

Ah nice. I've changed it and I'll push an update in a minute :+1:

ms32035 commented 1 year ago

Thanks @JC5 Two more new now:

Errors:
        -attribute components.schemas.BudgetLimitV2Array.BudgetLimitV2Read is not of type `schema`
        -attribute paths.'/v2/preferences/{name}'(get).responses.200.content.'application/vnd.api+json'.schema.#/components/schemas/PreferenceSingle is missing

The first one is a typo, because it should be BudgetLimitReadV2 The second one references a completely missing schema PreferenceSingle

Apologies for this painful back and forth, but I'd guess there will be a few more iterations.

JC5 commented 1 year ago

Not a problem at all, sometimes it's the only way to pick these things up. I'll get back to you!

JC5 commented 1 year ago

Done!

ms32035 commented 1 year ago

Thank @JC5, looks like the webserver hasn't refreshed

ms32035 commented 1 year ago

@JC5 the v2 spec is actually broken. only 1.9k lines vs 20k in v1

JC5 commented 1 year ago

There aren't that many v2 endpoints yet 🙈

ms32035 commented 1 year ago

🤦‍♂️ got confused with the versions and dates. The v2 file is still showing 2023-07-30T09:56:04+00:00 as generation timestamp

JC5 commented 1 year ago

Mmmm that will be the cdn. I'll see if I can purge it.

JC5 commented 1 year ago

The CDN is purged, 2.0.5 is also online. No changes in v1, but the chart endpoints have been extended (and made consistent). There are now two charts available in v2.

ms32035 commented 1 year ago

@JC5 v1 still fails with the same same error. Not sure what the issue is, but there seems to be some inconsistency between schema and properties for what's required here:

    RecurrenceTransactionUpdate:
      type: object
      required: []
      properties:
        id:
          type: string
          format: string
          required: true
          example: "ID of the recurring transaction. Not to be confused with the ID of the recurrence itself. Is marked as REQUIRED but can be skipped when there is only ONE transaction."

v2 generates fine now

JC5 commented 1 year ago

Feel free to suggest a solution, I'm out of ideas.

ms32035 commented 1 year ago

@JC5 this generates correctly

    RecurrenceTransactionUpdate:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: string
          example: "ID of the recurring transaction. Not to be confused with the ID of the recurrence itself. Is marked as REQUIRED but can be skipped when there is only ONE transaction."
JC5 commented 1 year ago

Nice, fixed.

ms32035 commented 1 year ago

Release 2.0.5.0 is out. Thanks @JC5