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: doc generation struct slice example value #7851

Merged
merged 1 commit into from
Jan 4, 2022
Merged

fix: doc generation struct slice example value #7851

merged 1 commit into from
Jan 4, 2022

Conversation

zl03jsj
Copy link
Contributor

@zl03jsj zl03jsj commented Dec 28, 2021

as you can see, all slice type example value is null in document:

### ChainGetParentMessages
ChainGetParentMessages returns messages stored in parent tipset of the
specified block.
Perms: read
Inputs:
```json
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
```
Response: `null`
### ChainGetParentReceipts
ChainGetParentReceipts returns receipts for messages in parent tipset of
the specified block. The receipts in the list returned is one-to-one with the
messages returned by a call to ChainGetParentMessages with the same blockCid.
Perms: read
Inputs:
```json
[
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
]
```
Response: `null`

fix: ExampleValue for a slice would be nil

add json.RawMessage ExampleValue.

the AlertEvent.Message needs a json.RawMessage example value, or would panic with json.MarshalJSON error.

type AlertEvent struct {
Type string // either 'raised' or 'resolved'
Message json.RawMessage
Time time.Time
}

@zl03jsj zl03jsj requested a review from a team as a code owner December 28, 2021 02:46
@zl03jsj zl03jsj changed the title Fix/doc gen slice Fix: doc generation struct slice example value Dec 28, 2021
@zl03jsj zl03jsj changed the title Fix: doc generation struct slice example value fix: doc generation struct slice example value Dec 28, 2021
Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

Thanks!

(Needs make docsgen to regenerate openrpc blobs)

@zl03jsj
Copy link
Contributor Author

zl03jsj commented Jan 4, 2022

make docsgen

done

@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

Merging #7851 (4172a3c) into master (9b11c4b) will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7851      +/-   ##
==========================================
- Coverage   39.45%   39.41%   -0.04%     
==========================================
  Files         654      654              
  Lines       70171    70171              
==========================================
- Hits        27684    27659      -25     
- Misses      37734    37750      +16     
- Partials     4753     4762       +9     
Impacted Files Coverage Δ
chain/stmgr/call.go 67.87% <0.00%> (-7.28%) ⬇️
markets/retrievaladapter/client_blockstore.go 62.50% <0.00%> (-6.25%) ⬇️
chain/messagepool/repub.go 51.61% <0.00%> (-4.31%) ⬇️
extern/sector-storage/sched.go 83.12% <0.00%> (-1.65%) ⬇️
miner/miner.go 55.29% <0.00%> (-1.33%) ⬇️
chain/stmgr/searchwait.go 66.02% <0.00%> (-1.29%) ⬇️
extern/storage-sealing/fsm.go 55.77% <0.00%> (-1.20%) ⬇️
chain/vm/vm.go 61.76% <0.00%> (-1.07%) ⬇️
chain/sync_manager.go 66.77% <0.00%> (-0.63%) ⬇️
extern/sector-storage/sched_worker.go 78.48% <0.00%> (-0.59%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b11c4b...4172a3c. Read the comment docs.

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

thanks!

@magik6k magik6k merged commit 0523c94 into filecoin-project:master Jan 4, 2022
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.

2 participants