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

Errors when Adding OpenAPI Service Reverence #364

Open
SSeelos opened this issue Sep 13, 2024 · 3 comments
Open

Errors when Adding OpenAPI Service Reverence #364

SSeelos opened this issue Sep 13, 2024 · 3 comments

Comments

@SSeelos
Copy link

SSeelos commented Sep 13, 2024

when i add the BCF-API swagger.json as an openAPI service reference in visual studio (.NET) i get compile errors from the generated code :/

image

image

@GeorgDangl
Copy link
Member

Hey @SSeelos, thank you for raising this issue!

Can you also try the newer one for the planned next version: https://app.swaggerhub.com/apis/buildingSMART/BCF/4.0

It was reworked quite a bit.

Also, could you share some more information about the errors? But, generally, I think the built-in generators in Visual Studio are often a bit lacking, so you could also try e.g. NSwag or the official Swagger generator and see if you get better results that way.

@SSeelos
Copy link
Author

SSeelos commented Sep 16, 2024

Hi, thanks @GeorgDangl for the reply.

same thing with 4.0.
visual studio uses NSwag by default.. heres a sample project where i just added the BCF swagger json as OpenAPI service reference:
https://github.com/SSeelos/MyBCF.git

it seems to generate multiple partial classes with overlapping properties
image

@SSeelos
Copy link
Author

SSeelos commented Sep 18, 2024

So, now i tried using NSwagStudio to generate the Client class.
Theres less errors but still there is this "Author" type that is not declared
Am i doing something wrong?

image
BCF.ClieBCF.Client/BCF.Client/Client.csnt/BCF.Client/Client.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants