Namespace JSON schema helpers under JSON ingestion#1203
Conversation
7bc0045 to
6267113
Compare
461ba24 to
64ff2af
Compare
6267113 to
040cea2
Compare
| require "elastic_graph/json_ingestion" | ||
|
|
||
| module ElasticGraph | ||
| module ElasticGraph::JSONIngestion |
There was a problem hiding this comment.
I'd encourage you to do the typical nesting thing:
module ElasticGraph
module JSONIngestion
# ...
end
endIt'll require you to indent every line but I can just ignore whitespace when reviewing and it'll hide lines with indentation-only changes. (Note: ignoring white space doesn't help when moving files as it appears that git's whitespace-ignoring feature doesn't apply to its file movement detection. That's why it's so nice to defer changing the indentation until the files have already moved.)
Besides being in line with how we write code everywhere else, it allows the code in the module to directly reference ElasticGraph:: constants, removing the need to prefix them with ::ElasticGraph as you've done here. That in turn leads to a smaller whitespace-ignored diff to review, and creates nicer code in the long run.
| "type" => { | ||
| "description" => "The type of object present in `record`.", | ||
| "type" => "string", | ||
| # Sorting doesn't really matter here, but it's nice for the output in the schema artifact to be consistent. |
There was a problem hiding this comment.
Would be nice to not remove comments unless they are inaccurate.
040cea2 to
e6a4787
Compare
64ff2af to
7d4becc
Compare
e6a4787 to
eb21230
Compare
Why
After the move-only PR preserves rename detection, put the moved helper constants under the
ElasticGraph::JSONIngestionnamespace.What
Risk Assessment
Medium - namespace-only behavior should be unchanged, but it updates call sites across schema_definition.
References