fix: bless-crawl skip serializing/deserializing none fields #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request enhances the serialization of multiple structs in
src/bless_crawl/mod.rsby adding the#[serde(skip_serializing_if = "Option::is_none")]attribute to optional fields.This change ensures that
Nonevalues are excluded from serialized output, reducing payload size and improving efficiency.Serialization Enhancements:
ScrapeOptionsstruct: Added#[serde(skip_serializing_if = "Option::is_none")]to optional fields likeinclude_tags,exclude_tags,viewport,user_agent, andheaders.Viewport,MapOptions, andCrawlOptionsstructs: Applied the same attribute to optional fields such aswidth,height,link_types,base_url,limit,max_depth, and others.PageMetadatastruct: Enhanced serialization by adding the attribute to a comprehensive list of optional metadata fields, includingtitle,description,language,keywords,og_*,twitter_*, and more.Responsestruct: Added the attribute to theerrorfield to exclude it from serialization whenNone.CrawlDatastruct: Applied the attribute to thelink_mapfield for more efficient serialization.…etadata, Response, and CrawlData structs