I have found a "standard" way to resolve.
I have defined the following (logical) media-type:
module MediaTypes
class Decode < Praxis::MediaType
identifier 'application/com.e-personam.decode'
description 'Decodifiche specifiche della struttura.'
attributes do
end
end
end
end
and the following (logical) resource:
require_relative 'business_units'
module V1
module Resources
class Decodes
include Praxis::ResourceDefinition
media_type V1::MediaTypes::Decode
version '1.0'
parent BusinessUnits
display_name 'Decodifiche di struttura'
action :show do
nodoc!
routing do
get '/'
end
end
end
end
end
Note that the show action was required to use this resource as parent to other resources, but I've also set the nodoc! statement at the show action level since that action is purely technical.
Then, in each decoded resource, I've defined the following parental relationship:
module V1
module Resources
module Decoded
class AnnuityTypes
include Praxis::ResourceDefinition
media_type V1::MediaTypes::Decoded::AnnuityType
version '1.0'
## before, it was directly bound to BusinessUnit as parent in this way:
## parent BusinessUnit
parent Decodes, business_unit_id: :business_unit_id
# actions and other stuff...
...
end
end
end
end
In this way, I can achieve my goal to have a well structured documentation.
Does it make sense, or there is an alternative way to achive the same goal, without defining new resources?