chitralverma opened a new issue, #9314:
URL: https://github.com/apache/opendal/issues/9314

   ### Feature Description
   
   Render a valid example for map-valued options in the generated service 
snippets on the website (`website/data/services.json`), and say on the service 
page that a `map` option takes a JSON object string.
   
   ### Problem and Solution
   
   The docs generator uses `...` as the example value for `ConfigType::HashMap` 
(`value_of` in `dev/src/generate/docs.rs`). Since #9262, a map option takes a 
JSON object string, so a copied `...` fails with `ConfigInvalid`. A JSON 
example also needs escaping, because the renderers wrap each value in double 
quotes without escaping it, and `{"key":"value"}` would break every snippet. No 
current default or example contains `"` or `\`.
   
   Proposal: use `{"key":"value"}` as the map placeholder. Escape `\` and `"` 
when rendering a value as a string literal, and also `#` for Ruby. Add one 
sentence to the service page hint. The commented `assume_role_session_tags` 
(S3) and `options` (hdfs-native) lines in the full snippets change, and nothing 
else.
   
   ### Additional Context
   
   - Follow-up to #9261 (closed) and #9262. #9261 listed this as one of four 
follow-ups.
   - Measured on main (4ae8e6122) by regenerating with the proposed change: 
exactly 10 snippet strings change. These are hdfs-native for Rust, Python, 
Node.js, and Go, and s3 for Rust, Java, Python, Node.js, Ruby, and Go.
   
   ### Are you willing to contribute to the development of this feature?
   
   - [x] Yes, I am willing to contribute to the development of this feature.
   
   *Drafted with AI assistance (Claude Code, Claude Opus 5.5) and reviewed by 
the author.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to