Hello Team! I am trying to make a c# client api as...
# help
k
Hello Team! I am trying to make a c# client api as a library using openapi generator using /api/swagger.yml, but I noticed that the api is split into 3 files: /api/authentication.yml, /api/authorization.yml and /api/swagger.yml. Do I need to combine them somehow to get full API? Building with just /api/swagger.yml seems to be missing some API functionality. How do I build the full API? Looking forward to any response!
i
hi @Kungim, nice effort. the
swagger.yml
should be enough - what functionality is missing for you? you can also check the
Makefile
(in the root directory) for reference - search for
client-java
or
sdk-rust
to see how the openapi-generator is used for these.
k
@Itai Gilo Thank you for your response. I wasn’t able to find methods to authorize via API, as in /auth/login in lakefs API reference. That’s why I thought it could be split into another OpenAPI doc
I’ve seen a Configuration struct (with access keys to login) in Rust generated API, but I couldn’t find one in c#
i
have you checked the authorization docs? this whole section might be useful in this case.
k
@Itai Gilo yes, but it doesn’t discuss what api methods are used. I am able to login with plain post request, but can’t find this functionality in generated api methods
i
you wrote about seeing such struct in the Rust code - can you specify which one it is? and what exactly is missing in your generated code?
note that the Rust sdk is generated using this code:
Copy code
sdk-rust: api/swagger.yml  ## Generate SDK for Rust client - openapi generator version 7.1.0
	rm -rf clients/rust
	mkdir -p clients/rust
	$(OPENAPI_RUST_GENERATOR) generate \
		-i /mnt/api/swagger.yml \
		-g rust \
		--additional-properties=infoName=Treeverse,infoEmail=services@treeverse.io,packageName=lakefs_sdk,packageVersion=$(PACKAGE_VERSION),packageUrl=<https://github.com/treeverse/lakeFS/tree/master/clients/rust> \
		-o /mnt/clients/rust