chore: add 403 forbidden response to endpoints - #153
Conversation
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||
| #[serde(untagged)] | ||
| pub enum GetJobError { | ||
| Status403(models::ApiErrorResponse), |
There was a problem hiding this comment.
nit: A 404 response body now deserializes as GetJobError::Status403 (not blocking).
GetJobError is #[serde(untagged)], so serde returns the first variant that matches. Status403 and Status404 wrap the same type, models::ApiErrorResponse. Line 89 parses the body without checking the HTTP status. Callers that match on Status404 stop matching after this change. The same change applies to InformationSchemaError in src/apis/information_schema_api.rs:20.
Many other error enums in src/apis/ already have this problem, so a fix belongs in the generator template. One option is to select the variant from status instead of relying on untagged deserialization. Another option is to note the variant change in the CHANGELOG entry.
Auto-generated from the updated HotData OpenAPI spec.
Source: https://github.com/hotdata-dev/www/pull/434