[14/n] [dropshot_endpoint] support tag_config in API traits#1059
Conversation
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
tag_config in api_descriptiontag_config in API traits
tag_config in API traitstag_config in API traits
Created using spr 1.3.6-beta.1
| /// A mirror of dropshot's `EndpointTagPolicy`, used as part of arguments to the | ||
| /// top-level `api_description` macro. | ||
| #[derive(Clone, Copy, Default, Deserialize, Debug)] | ||
| #[serde(rename_all = "snake_case")] |
There was a problem hiding this comment.
are there other places where we use snake_case in a similar setting?
There was a problem hiding this comment.
Hmm, I don't think so -- we use snake_case for keys but don't have any other places where enum variants are tagged as values. snake_case looks more correct to me here though, do you think otherwise?
There was a problem hiding this comment.
I guess I don't have an opinion. It seemed odd to me... based on my knowledge of the implementation of serde_tokenstream, not as an end-user. Maybe show it to a couple of unbiased people and see if they have a preference?
There was a problem hiding this comment.
Ran a poll on Mastodon which overwhelmingly agreed with you: https://hachyderm.io/@rain/112832705113530863
But one suggestion was to use EndpointTagPolicy::AtLeastOne, i.e. the actual value in there. I like that a lot. I think that should be possible with ParseWrapper, right?
There was a problem hiding this comment.
Implemented this and I really like it, but at what cost: oxidecomputer/serde_tokenstream#195
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Based on today's discussion, we're supporting a static
tag_configargument toapi_description. The implementation just creates adropshot::TagConfigandsets that.