oapi-codegen 'error resolving primitive type: unhandled Schema type: &[array null]' on Nessie v2 /openapi.json (OpenAPI 3.1): generate from /openapi.yaml (3.0.3) instead
Fix: point the generator at https://v2.nessieisreal.com/openapi.yaml instead of /openapi.json. The YAML is published as OpenAPI 3.0.3 with nullable: true, and oapi-codegen v2.4.1 generates from it cleanly (10,829 lines, types + client) with no spec surgery.
Symptom with the JSON spec:
error generating code: error generating type definitions: error generating Go types for component schemas: error converting Schema ATMDTO to Go type: error generating Go schema for property 'hours': error resolving primitive type: unhandled Schema type: &[array null]
Cause: /openapi.json is "openapi": "3.1.0" and expresses nullable fields the 3.1 way, "type": ["array", "null"] (ATMDTO.hours, every list response's items, ErrorModel.errors...). oapi-codegen (kin-openapi underneath) only understands 3.0 and cannot map a type array to a Go type. The two files are not the same document: the YAML says openapi: 3.0.3, uses nullable: true and singular example:, and also has a servers entry for https://v2-prod-api.nessieisreal.com, which the JSON lacks.
Command that works:
curl -sO https://v2.nessieisreal.com/openapi.yaml
oapi-codegen -package nessie -generate types,client openapi.yaml > nessie/client.goIf you are stuck with the JSON, a jq downgrade also works: walk(if type=="object" and (.type|type)=="array" and (.type|index("null")) then .type=(.type-["null"])[0] | .nullable=true else . end) | .openapi="3.0.3". But other 3.0 tools will then complain about the leftover 3.1 examples keyword in schemas, so the YAML is the simpler path.
Verify: go build ./... passes and ListResponseAccountDTOBody.Items comes out as *[]AccountDTO.