keygen-sh / keygen-api

Keygen is a fair source software licensing and distribution API built with Ruby on Rails. For developers, by developers.
https://keygen.sh
Other
701 stars 40 forks source link

Add uuid param type for relationship IDs #745

Closed ezekg closed 1 year ago

ezekg commented 1 year ago

It's a common misunderstanding when a user tries to e.g. create a machine for a license using the license's key instead of its UUID. To communicate better errors, and to try and improve the DX here, we should add a :uuid type to our typed_params initializer and update all relationship params to use :uuid:

param :relationships do
  param :license do
    param :data do
-     param :id, type: :string
+     param :id, type: :uuid
      param :type, type: :string
    end
  end
end