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

Don't understand the difference between rust and rust-server #164

Closed
BartMassey opened this issue May 28, 2018 · 4 comments
Closed

Don't understand the difference between rust and rust-server #164

BartMassey opened this issue May 28, 2018 · 4 comments

Comments

@BartMassey
Copy link

Description

I've been trying to get a fairly complex OpenAPI spec running with the Rust codegen for a while now. One of the stumbling blocks for me is that there are two versions of this generator: rust and rust-server. I'm probably just being dense, but I don't understand the difference between them, nor which one I should be working on. Is there documentation somewhere I've missed?

openapi-generator version

Current Git master, at commit 37df59d .

OpenAPI declaration file content or url

N/A

Command line used for generation

N/A

Steps to reproduce

Examine modules/openapi-generator/src/main/resources for the rust and rust-server resources.

Related issues/PRs

N/A

Suggest a fix/enhancement

Documentation on these two modules and the differences between them would be useful. Ideally, they could be merged.

@wing328
Copy link
Member

wing328 commented May 28, 2018

@BartMassey very good question. rust-server generates both rust client and server while rust only generates a rust client.

There were discussion to consolidate the clients into one (rust) while rust-server will then only generate server code moving forward but no consensus has been reached and we hope to do that in 4.x release of OpenAPI Generator.

@BartMassey
Copy link
Author

Thanks for the quick response!

I guess I'm still a little confused about the architecture of the whole thing. It looks like most languages don't have a separate server package. Does this mean that only clients can be generated for them, or does it mean that both client and server code are generated for them using the same resources?

I'm assuming the "server" case is about generating parsers instead of generators for requests? Or am I missing something?

Sorry about all the questions: just trying to understand where and how to dive in when I get time.

@wing328
Copy link
Member

wing328 commented May 28, 2018

These are very good questions 👍

I guess I'm still a little confused about the architecture of the whole thing. It looks like most languages don't have a separate server package.

Yes, e.g. lua generator only genreates the Lua client.

Does this mean that only clients can be generated for them, or does it mean that both client and server code are generated for them using the same resources?

Yes, only client is generated if the generator is named with a programming language. For most server generators, we add the "-server" suffix unless the generator name already implies the server-side framework (e.g. ruby-on-rails)

I'm assuming the "server" case is about generating parsers instead of generators for requests? Or am I missing something?

It's for generating server stub - boilerplate code for REST API server, so that developers can have a REST API server up and running very easily given an OpenAPI spec.

@jmini
Copy link
Member

jmini commented May 28, 2018

About the name of the generators, yes the current situation with one single --generator-name switch is confusing (not only for rust). @jimschubert has proposed to have other switches to select what should be created. You can give feedback in #137.

@wing328 wing328 closed this as completed Feb 25, 2019
nilskuhn pushed a commit to nilskuhn/openapi-generator that referenced this issue Apr 6, 2023
…onorepo

fix(deps): update nest monorepo to v7.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants