I am currently investigating a similar matter and stumbled upon a possible explanation/solution, saying that "required" and "nullable" are different notions in OpenAPI spec. The property "surname" being declared optional (required:false) does not make it nullable, it just allows it to be omitted entirely. To be able to include it but with a null value, you set it as "nullable: true" (and it can still be set to "required: true" even in that case, meaning that it has to be included even it's null).
Haven't tested that yet, though. Neither do I know if Swagger UI will handle this schema correctly, actually emitting the property as null when applicable.