Skip to content

Conversation

spikespaz
Copy link
Contributor

This is a rebased #418 by @drahnr on latest main. I've cleaned the diff of any spurious changes that aren't directly related to multipart/form-data support1.

Still need to:

  • Ensure that the above statement about focus/scope is true.
  • Test this patch on my side, to ensure that it functions for my purposes.
  • Address all review comments from the original PR impl "multipart/form-data" support #418.
  • My own satisfaction.

Closes #402

Footnotes

  1. With the one exception of a cargo: lints: forbid unused_crate_dependencies commit. If this is to be rebase-merged, I'd like to keep it, if it's squashed, remove it.

.body(
serde_urlencoded::to_string(body)
.map_err(|_| Error::InvalidRequest("failed to serialize body".to_string()))?,
serde_urlencoded::to_string(body).map_err(|e| {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spurious, consider moving to another commit.

/// OpenAPI generator.
pub struct Generator {
type_space: TypeSpace,
forms: IndexSet<TypeId>,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better name?


let client_docstring = {
let mut s = format!("Client for {}", spec.info.title);
let mut doc = format!("Client for {}", spec.info.title);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stylistic change, move out.

.type_space
.get_type(type_id)
.unwrap()
.expect("TypeIDs are _never_ deleted. qed")
Copy link
Contributor Author

@spikespaz spikespaz Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown unsupported in terminal emulators. Remove emphasis.

What is "qed"?

Spurious?

} if enumeration.is_empty() => Ok(()),
_ => Err(Error::UnexpectedFormat(format!(
"invalid schema for application/octet-stream: {:?}",
"invalid schema for {}: {:?}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated stylistic change.

// type: "string"
// format: "binary"
// ```
// "schema": {
Copy link
Contributor Author

@spikespaz spikespaz Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs code block.

Clarify.

Reduce indentation level inside YAML block.

.fmt(expander::Edition::_2021)
.verbose(true)
.write_to_out_dir(output)
.expect("Writing file works. qed");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this change?

serde_yaml = "0.9"
serde_tokenstream = "0.2.0"
syn = { version = "2.0", features = ["full", "extra-traits"] }
expander = "2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purpose?

@@ -0,0 +1,51 @@
// Copyright 2022 Oxide Computer Company
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New file needs updated copyright.

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

Successfully merging this pull request may close these issues.

form-data as content type yet to be implemented

2 participants