Closed brendanhay closed 2 years ago
A note on naming of (product) smart constructors and (sum) pattern synonym accessors:
mk
as the prefix for smart constructors. I changed this to new
to be consistent with amazonka
at the cost of having to disambiguate some record fields like newPrice
in gogol-android-publisher
.amazonka
, the pattern synonym newtypes for sums uses from<Name>
.This is mildly unfortunate, probably it would've been better to use mk
/ un
as the prefixes since we'd likely never have to special case anything, but I hope for the day we can just pervasively enable NoFieldSelectors
and not deal with this.
Closes #169
Can we get a new release to hackage with these changes included. A lot of useful fixes have accumulated on the main
branch by now, including ones I believe should allow compiling with the new Stackage LTS 19 snapshots.
It appears the docs for the new types don't reflect on hackage. It's not clear to me how the fields should be used, since the old lens accessors don't work anymore
Summary of changes
Textual
) by embedding their use directly into the related serialisation instances, ie.{To,From}JSON
. This allows the OpenAPI(type, format)
tuple to correctly handle{u,}int64
and similar numeric types that are encoded as "type: string". There is further work still to do here, primarily around date/time related types, to make using the now fully exported data constructors more palatable in the cases custom de/serialisation of fields is required.nix develop .
no-field-selectors
has be added which defaults toTrue
and will enable the GHC >= 9.2.1NoFieldSelectors
extension, if supported.Flatten.hs
, naming, I know) out of nested JSONSchema properties are now named according to<parent>_<property>
. Previously a schema like"Location": { "properties": { "metadata": { "type": .. } } }
would've synthesisedLocationMetadata
, which is potentially ambiguous, so now the generator will produceLocation_Metadata
.id
. For example,{ "resources": { .. { "id": "storage.buckets.insert" }
which would previously have floateddata BucketsInsert
inNetwork.Google.Storage.Buckets.Insert
, will now floatdata StorageBucketsInsert
in the same namespace. Again, this removes an additional source of ambiguity from code synthesis.aeson >= 2.0
.ListT
instances.Moving forward
stack
support, and enable GitHub actions.HasScope
and scope related nonsense.