Test enum support


The openapi generator has a known bug [0] which results into the
enums being properly handled only when they are represented as
separate schemas.

This patch modifies the petstore.yaml file accordingly and tries
to make sure that the enum model is actually generated and used.

So far, the following fixes are done:
* Fix the model-header template to include the Enum header when needed.
  Previously, the Object header was included unconditionally.
* Fix the model to pass the enum into setValue() by value instead of
  passing by const-ref.
* Fix a bug that m_valueIsValid was not set to true in setValue().
* Fix a bug that the enum value and flags were not reset if a
  non-existing value was passed to fromJson().
* Fix generator tag positions in order to get better formatting of
  the generated code.

Regenerate the go server with the updated yaml file and adjust the
code to the changes.
Adapt the PetApiTest test to the changes in the model.

[0]: https://github.com/OpenAPITools/openapi-generator/issues/2645

Task-number: QTBUG-139919
Change-Id: I7dfb90776f10ee59ef489b9d552bb27d850ebe19
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commit76dca9db29198ffbe2555ffc82780c2a39849702
parent357b4fc2f8d86a3a58434c15d04706ee7dc45e73
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 11 Nov 2025 15:57:40 +0100