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

Generating code: cannot unmarshal !!int 0 into bool #1366

Open
bqback opened this issue Dec 14, 2024 · 0 comments
Open

Generating code: cannot unmarshal !!int 0 into bool #1366

bqback opened this issue Dec 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bqback
Copy link

bqback commented Dec 14, 2024

What version of ogen are you using?

github.com/ogen-go/ogen v1.8.1

Can this issue be reproduced with the latest version?

Yes (used the latest version from go get).

What did you do?

Ran go generate on the Mistral AI OpenAPI spec.

What did you expect to see?

Generated files based on the spec.

What did you see instead?

A few errors of the same type:

  - mistral.yaml:1383:29 -> cannot unmarshal !!int `0` into bool
          1380 |           title: Ref
          1381 |         weight:
          1382 |           default: 1
        → 1383 |           exclusiveMinimum: 0
          1384 |           title: Weight
          1385 |           type: number
          1386 |         commit_id:
          1387 |           maxLength: 40
  - mistral.yaml:1629:33 -> cannot unmarshal !!int `0` into bool
          1626 |           title: Warmup Fraction
          1627 |         epochs:
          1628 |           anyOf:
        → 1629 |             - exclusiveMinimum: 0
          1630 |               type: number
          1631 |             - type: 'null'
          1632 |           title: Epochs
          1633 |         fim_ratio:
  - mistral.yaml:1796:29 -> cannot unmarshal !!int `0` into bool
          1793 |           title: Ref
          1794 |         weight:
          1795 |           default: 1
        → 1796 |           exclusiveMinimum: 0
          1797 |           title: Weight
          1798 |           type: number
          1799 |         token:
          1800 |           title: Token
  - mistral.yaml:1886:29 -> cannot unmarshal !!int `0` into bool
          1883 |           type: string
          1884 |         weight:
          1885 |           default: 1
        → 1886 |           exclusiveMinimum: 0
          1887 |           title: Weight
          1888 |           type: number
          1889 |       required:
          1890 |         - file_id
  - mistral.yaml:1946:33 -> cannot unmarshal !!int `0` into bool
          1943 |             [mistral-finetune](https://github.com/mistralai/mistral-finetune)
          1944 |         epochs:
          1945 |           anyOf:
        → 1946 |             - exclusiveMinimum: 0
          1947 |               type: number
          1948 |             - type: 'null'
          1949 |           title: Epochs
          1950 |         fim_ratio:

Not sure why it tries to convert the values into bool if the type is specified as number.

@bqback bqback added the bug Something isn't working label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant