Skip to content

Conversation

@asinghvi17
Copy link

@asinghvi17 asinghvi17 commented Oct 21, 2025

Summary

Wraps all identifiers (parameter names, function names, data types, property names, return types) in backticks in Julia client and server documentation to prevent markdown from interpreting underscores as italic formatting.

Problem

Identifiers like pet_id, api_key, Custom_Type render incorrectly in markdown documentation because underscores are treated as italic markers.

Solution

Added backticks to all identifier references across Julia templates:

Templates Modified

Code docstrings:

  • julia-client/api.mustache - Function docstrings in generated Julia code

Markdown API documentation:

  • julia-client/api_doc.mustache - Function signatures, parameters, return types
  • julia-server/api_doc.mustache - Same for server

Markdown model documentation:

  • julia-client/model_doc.mustache - Property names and types
  • julia-server/model_doc.mustache - Same for server

Samples Regenerated

Both Julia client and server samples updated to demonstrate the fix.

Example

Before:

Params:
- pet_id::Int64
**pet_id** | **Int64** | ID of pet
Return: Custom_Type

Renders with broken italics: petid

After:

Params:
- `pet_id`::`Int64`
**`pet_id`** | **`Int64`** | ID of pet
Return: `Custom_Type`

Renders correctly with literal underscores.

Fixes JuliaComputing/OpenAPI.jl#72

Wrap parameter names in backticks in generated Julia client docstrings
to prevent markdown from misinterpreting underscores as italic formatting.

This fixes an issue where parameter names like `pet_id`, `api_key`, and
`additional_metadata` would render incorrectly in documentation, with
underscores being treated as markdown italic markers instead of literal
characters.

Related issue: JuliaComputing/OpenAPI.jl#72
@wing328
Copy link
Member

wing328 commented Oct 21, 2025

please follow step 3 in the PR checklist to update the samples

Extend backtick formatting to markdown documentation templates for
both Julia client and server generators. This ensures consistent
markdown rendering of identifiers with underscores.

Changes:
- julia-client/api_doc.mustache: Add backticks to function signatures,
  parameter names, types, and return types in markdown API docs
- julia-server/api_doc.mustache: Same changes for server API docs
- julia-client/model_doc.mustache: Add backticks to property names and
  types in markdown model documentation
- julia-server/model_doc.mustache: Same changes for server model docs

All generated markdown files now properly display identifiers like
`pet_id`, `Custom_Type`, `update_pet_with_form` with literal
underscores instead of broken italic formatting.

Related to JuliaComputing/OpenAPI.jl#72
@wing328
Copy link
Member

wing328 commented Oct 23, 2025

thanks for the pr and updating the samples

cc @tanmaykm for review

@@ -0,0 +1,98 @@
# Plan: Add Backticks to All Julia Template Documentation
Copy link
Member

Choose a reason for hiding this comment

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

is this file required as part of the change?

Copy link
Author

Choose a reason for hiding this comment

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

Definitely not - will put some work in on this tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docstrings need to embed parameters in backticks

2 participants