Class: ManyfoldApi::V0::CreatorSerializer
- Inherits:
-
ApplicationSerializer
- Object
- ApplicationSerializer
- ManyfoldApi::V0::CreatorSerializer
- Defined in:
- app/serializers/manyfold_api/v0/creator_serializer.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ApplicationSerializer
#collection_ref, #context, #creator_ref, #file_ref, #group_ref, #initialize, #license, #model_ref, #ref, schema_ref, schema_ref_name
Constructor Details
This class inherits a constructor from ManyfoldApi::V0::ApplicationSerializer
Class Method Details
.schema ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/serializers/manyfold_api/v0/creator_serializer.rb', line 14 def self.schema { type: :object, properties: { "@context": {"$ref" => "#/components/schemas/jsonld_context"}, "@id": {type: :string, example: "https://example.com/creators/abc123"}, "@type": {type: :string, example: "Organization"} }.merge(CreatorDeserializer.schema[:properties]), required: ["@context", "@id", "@type"] } end |
Instance Method Details
#serialize ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'app/serializers/manyfold_api/v0/creator_serializer.rb', line 3 def serialize creator_ref(@object).merge( "@context": context, name: @object.name, slug: @object.slug, caption: @object.caption, description: @object.notes, links: @object.links.map { LinkSerializer.new(it).serialize } ).compact end |