profile
viewpoint
Andrew Paseltiner apasel422 Google

apasel422/eclectic 22

Experimental collection traits for Rust

apasel422/tree 4

An ordered map and set based on a binary search tree.

apasel422/pairing-heap 2

A priority queue based on a pairing heap

apasel422/binomial-heap 1

A priority queue based on a binomial heap

apasel422/skew-heap 1

A priority queue based on a skew heap

delete branch apasel422/preload-spammy.permission.site

delete branch : patch-1

delete time in 2 months

Pull request review commentgoogleapis/aip

[AIP-146] Generic fields

+---+aip:+  id: 146+  state: reviewing+  created: 2019-05-28+permalink: /146+redirect_from:+  - /0146+---++# Generic fields++Most fields in any API, whether in a request, a resource, or a custom response,+have a specific type or schema. This schema is part of the contract that+developers write their code against.++However, occasionally it is appropriate to have a generic or polymorphic field+of some kind that can conform to multiple schemata, or even be entirely+free-form.++## Guidance++While generic fields are generally rare, a service **may** introduce generic+field where necessary. There are several approaches to this depending on how+generic the field needs to be; in general, services **should** attempt to+introduce the "least generic" approach that is able to satisfy the use case.++### Oneof++A `oneof` **may** be used to introduce a type union: the user or service is+able to specify one of the fields inside the oneof. Additionally, a `oneof`+**may** be used with the same type (usually strings) to represent a sematic+difference between the options.++Because the individual fields in the oneof have different keys, a developer can+programatically determine which (if any) of the fields is populated.++A `oneof` preserves the largest degree of type safety and semantic meaning for+each option, and services **should** generally prefer them over other generic+or polymorphic options when feasible. However, the `oneof` construct is+ill-suited when there is a large (or unlimited) number of potential options, or+when there is a large resource structure that would require a long series of+"cascading oneofs".++**Note:** Adding additional possible fields to an existing `oneof` is a+non-breaking change, but moving existing fields into or out of a `oneof` is+breaking (it creates a backwards-incompatible change in Go protobuf stubs).++### Maps++Maps **may** be used in situations where a situation where many values _of the+same type_ are needed, but the keys are unknown or user-determined.++Maps are usually not appropraiate for generic fields because the map values all

s/appropraiate/appropriate/

lukesneeringer

comment created time in 2 months

Pull request review commentgoogleapis/aip

[AIP-146] Generic fields

+---+aip:+  id: 146+  state: reviewing+  created: 2019-05-28+permalink: /146+redirect_from:+  - /0146+---++# Generic fields++Most fields in any API, whether in a request, a resource, or a custom response,+have a specific type or schema. This schema is part of the contract that+developers write their code against.++However, occasionally it is appropriate to have a generic or polymorphic field+of some kind that can conform to multiple schemata, or even be entirely+free-form.++## Guidance++While generic fields are generally rare, a service **may** introduce generic+field where necessary. There are several approaches to this depending on how+generic the field needs to be; in general, services **should** attempt to+introduce the "least generic" approach that is able to satisfy the use case.++### Oneof++A `oneof` **may** be used to introduce a type union: the user or service is+able to specify one of the fields inside the oneof. Additionally, a `oneof`+**may** be used with the same type (usually strings) to represent a sematic

s/sematic/semantic/

lukesneeringer

comment created time in 2 months

startedgoogle/wuffs

started time in 3 months

more