-
Notifications
You must be signed in to change notification settings - Fork 392
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
docs(parser): change parser documentation #5262
base: develop
Are you sure you want to change the base?
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
|
Quality Gate passedIssues Measures |
Hey @leandrodamascena ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @anafalcao! This is amazing to start reviewing this PR, indeed a great improvement in our documentation.
I see we have room to improve some areas and I left some comments. Can you please review and address them before we move to the next round of this review?
handler(event=payload, context=LambdaContext()) | ||
handler(event=json.dumps(payload), context=LambdaContext()) # also works if event is a JSON string | ||
``` | ||
#### Parse function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @anafalcao, there is something weird here. Pls take a look
```python title="getting_started_with_parser.py" | ||
--8<-- "examples/parser/src/getting_started_with_parser.py" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights here.
```python | ||
--8<-- "examples/parser/src/envelope_with_event_parser.py" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights.
```json | ||
--8<-- "examples/parser/src/envelope_payload.json" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights.
resources: List[str] | ||
detail_type: str = Field(None, alias="detail-type") | ||
detail: Dict[str, Any] | ||
--8<-- "examples/parser/src/bring_your_own_envelope.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights.
parsed_envelope = EventBridgeModel.model_validate(data) | ||
return self._parse(data=parsed_envelope.detail, model=model) | ||
```json | ||
--8<-- "examples/parser/src/bring_your_own_envelope.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights.
```python title="field_validator.py" | ||
--8<-- "examples/parser/src/field_validator.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights.
```python title="field_validator_all_values.py" | ||
--8<-- "examples/parser/src/field_validator_all_values.py" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights.
```python title="model_validator.py" | ||
--8<-- "examples/parser/src/model_validator.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights.
```python | ||
--8<-- "examples/parser/src/string_fields_contain_json.py" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing highlights.
Issue number: #1371
Summary
This PR refreshes Parser docs with newer features like examples, improves wording and navigation, focused on Powertools v3.
Changes
User experience
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.