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

fix: Remove optional params as null in docs #229

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

ksentak
Copy link
Contributor

@ksentak ksentak commented Nov 6, 2024

When generating documentation from the OpenRPC, some methods have optional fields in either the request or response. These fields don't have to be present AT ALL if not needed.

Due to how the tooling is interpreting the schema vs the examples, documentation is being generated that infers that you must pass or receive these fields with "null" as the value instead of having the option to omit them entirely.

This PR fixes the documentation so that null is not passed as the value of an optional parameter that is not used in the examples section for a method.

// Example of what documentation currently looks 
let advertisingId = await Advertising.advertisingId(null)

// What documentation will now look like
let advertisingId = await Advertising.advertisingId()

If a method has multiple optional parameters and there is an example that sets the second optional parameter, undefined will be used as the first parameter.

method(undefined, 'value')

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.

1 participant