nytimes / openapi2proto

A tool for generating Protobuf v3 schemas and gRPC service definitions from OpenAPI specifications
Apache License 2.0
964 stars 98 forks source link

Handling string-type attributes with 'byte' format (base64-encoded byte-arrays) #51

Closed chrusty closed 6 years ago

chrusty commented 6 years ago

This would allow OpenAPI / Swagger definitions like this:

jsonbytesblob:
        type: string
        format: byte

which would result in a proto like this: bytes jsonbytesblob = 1;

I realise that openapi2proto already supports a type called bytes which achieves the same thing, but this change would be more in line with the OpenAPI standards outlined here: https://swagger.io/docs/specification/data-models/data-types/#string

jprobinson commented 6 years ago

👌 🍕 thanks, @chrusty!!