File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/cpp-pistache-server
samples/server/petstore/cpp-pistache/.openapi-generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ struct {{classname}}
2424 { {^required} }Pistache::Optional<{ {/required} }{ {{dataType} }}{ {^required} }>{ {/required} } { {baseName} };
2525 { {/vars} }
2626
27+ bool operator==(const { {classname} }& other) const;
28+ bool operator!=(const { {classname} }& other) const;
29+
2730 nlohmann::json to_json() const;
2831 static { {classname} } from_json(const nlohmann::json& j);
2932};
Original file line number Diff line number Diff line change @@ -21,6 +21,16 @@ nlohmann::json {{classname}}::to_json() const
2121 return o;
2222}
2323
24+ bool { {classname} }::operator==(const { {classname} }& other) const
25+ {
26+ return {{#vars} }{ {baseName} } == other.{ {baseName} }{ {#hasMore} } && { {/hasMore} }{ {/vars} };
27+ }
28+
29+ bool { {classname} }::operator!=(const { {classname} }& other) const
30+ {
31+ return ! (*this == other);
32+ }
33+
2434void to_json(nlohmann::json& j, const { {classname} }& o)
2535{
2636 {{#vars} }
Original file line number Diff line number Diff line change 1- 4.2.1 -SNAPSHOT
1+ 4.2.2 -SNAPSHOT
You can’t perform that action at this time.
0 commit comments