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

Properties with type integer and format int64 generate properties of type int instead of type long using the C# generator #2053

Closed
2 tasks done
jespitae opened this issue Jun 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jespitae
Copy link

Describe the bug.

The following piece of asyncapi specification:
image

Results in the following property:
image

Expected behavior

We would expect that this asyncapi specification would have generated a property of type long.
When using the Java generator it does result in Long properties.

Screenshots

Screenshots provided earlier.

How to Reproduce

We used version 2.0.2 of the asyncapi cli and version 3.5.3 of modelina and ran the following command:
asyncapi generate models csharp ./asyncapi.json --namespace=Test --output=Models --csharpSystemJson
Our async api specification is defined in version 2.4.0.

🥦 Browser

None

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

@jespitae jespitae added the bug Something isn't working label Jun 20, 2024
Copy link
Contributor

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@jonaslagoni
Copy link
Sponsor Member

We have something similar for Java:

switch (constrainedModel.options.format) {
we just need to adapt: https://github.com/asyncapi/modelina/blob/0db19cc2e99ad0bdb09b961a91d5511d061077f0/src/generators/csharp/CSharpConstrainer.ts#L55C12-L55C33 for C#

Happy to accept a PR @jespitae 🤙 Please target the next branch 🙂

@jespitae
Copy link
Author

jespitae commented Jun 20, 2024

Hi,

I made a PR with the required change: #2054
Thanks for the quick response!

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

2 participants