Skip to content
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

[Bug] Log response if ParsingModel has validation errors #2706

Closed
estahn opened this issue Nov 23, 2023 · 3 comments
Closed

[Bug] Log response if ParsingModel has validation errors #2706

estahn opened this issue Nov 23, 2023 · 3 comments
Labels
python Python models, clients, and server interfaces

Comments

@estahn
Copy link

estahn commented Nov 23, 2023

We see the following in our error reporting:

ValidationError
6 validation errors for ParsingModel[GetApi1ProductsResponse]
__root__ -> response -> 0 -> energy_site_id
 field required (type=value_error.missing)
__root__ -> response -> 0 -> resource_type
 field required (type=value_error.missing)
__root__ -> response -> 0 -> asset_site_id
 field required (type=value_error.missing)
__root__ -> response -> 0 -> sync_grid_alert_enabled
 field required (type=value_error.missing)
__root__ -> response -> 0 -> breaker_alert_enabled
 field required (type=value_error.missing)
__root__ -> response -> 0 -> components
 field required (type=value_error.missing)

At this point we have no further information to rectify the issue and need to manually instrument this. It would be great if fern already adds capability to provide further details on this, e.g. the actual response.

@dsinghvi
Copy link
Member

@estahn makes sense -- so basically you want fern to print the json + validation error with pydantic

@estahn
Copy link
Author

estahn commented Nov 23, 2023

@dsinghvi Maybe not print. Either via logging or an exception that contains the validation error as well as the response object.

@dannysheridan dannysheridan transferred this issue from another repository Jan 22, 2024
@dannysheridan dannysheridan added the python Python models, clients, and server interfaces label Jan 22, 2024
@dannysheridan dannysheridan changed the title Log response if ParsingModel has validation errors [Bug] Log response if ParsingModel has validation errors Jan 22, 2024
@armandobelardo
Copy link
Contributor

Closing to consolidate with: #3069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python models, clients, and server interfaces
Development

No branches or pull requests

4 participants