From 5dc6a67ef6337b46e7337eb6cd8b7f176d9110a3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 8 Feb 2024 12:11:17 +0100 Subject: [PATCH] wip --- openapi.yaml | 1766 +++++++++++++++++++++++ src/ApiResource/PartnerApi.php | 3 + src/Mapper/PartnerApiToEntityMapper.php | 1 + 3 files changed, 1770 insertions(+) create mode 100644 openapi.yaml diff --git a/openapi.yaml b/openapi.yaml new file mode 100644 index 0000000..1af3dc3 --- /dev/null +++ b/openapi.yaml @@ -0,0 +1,1766 @@ +openapi: 3.1.0 +info: + title: 'Matsen API Platform' + description: '' + version: 1.0.0 +servers: + - + url: / + description: '' +paths: + /api/contacts: + get: + operationId: api_contacts_get_collection + tags: + - Contact + responses: + 200: + description: 'Contact collection' + content: + application/ld+json: + schema: + type: object + properties: + 'hydra:member': { type: array, items: { $ref: '#/components/schemas/Contact.jsonld' } } + 'hydra:totalItems': { type: integer, minimum: 0 } + 'hydra:view': { type: object, properties: { '@id': { type: string, format: iri-reference }, '@type': { type: string }, 'hydra:first': { type: string, format: iri-reference }, 'hydra:last': { type: string, format: iri-reference }, 'hydra:previous': { type: string, format: iri-reference }, 'hydra:next': { type: string, format: iri-reference } }, example: { '@id': string, type: string, 'hydra:first': string, 'hydra:last': string, 'hydra:previous': string, 'hydra:next': string } } + 'hydra:search': { type: object, properties: { '@type': { type: string }, 'hydra:template': { type: string }, 'hydra:variableRepresentation': { type: string }, 'hydra:mapping': { type: array, items: { type: object, properties: { '@type': { type: string }, variable: { type: string }, property: { type: [string, 'null'] }, required: { type: boolean } } } } } } + required: + - 'hydra:member' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Contact' + text/html: + schema: + type: array + items: + $ref: '#/components/schemas/Contact' + application/hal+json: + schema: + type: object + properties: + _embedded: { type: array, items: { $ref: '#/components/schemas/Contact.jsonhal' } } + totalItems: { type: integer, minimum: 0 } + itemsPerPage: { type: integer, minimum: 0 } + _links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } } + required: + - _links + - _embedded + summary: 'Retrieves the collection of Contact resources.' + description: 'Retrieves the collection of Contact resources.' + parameters: + - + name: page + in: query + description: 'The collection page number' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 1 + style: form + explode: false + allowReserved: false + deprecated: false + post: + operationId: api_contacts_post + tags: + - Contact + responses: + 201: + description: 'Contact resource created' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Contact.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Contact' + text/html: + schema: + $ref: '#/components/schemas/Contact' + application/hal+json: + schema: + $ref: '#/components/schemas/Contact.jsonhal' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + summary: 'Creates a Contact resource.' + description: 'Creates a Contact resource.' + parameters: [] + requestBody: + description: 'The new Contact resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Contact.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Contact' + text/html: + schema: + $ref: '#/components/schemas/Contact' + application/hal+json: + schema: + $ref: '#/components/schemas/Contact.jsonhal' + required: true + deprecated: false + parameters: [] + '/api/contacts/{id}': + get: + operationId: api_contacts_id_get + tags: + - Contact + responses: + 200: + description: 'Contact resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Contact.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Contact' + text/html: + schema: + $ref: '#/components/schemas/Contact' + application/hal+json: + schema: + $ref: '#/components/schemas/Contact.jsonhal' + 404: + description: 'Resource not found' + summary: 'Retrieves a Contact resource.' + description: 'Retrieves a Contact resource.' + parameters: + - + name: id + in: path + description: 'ContactApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + deprecated: false + delete: + operationId: api_contacts_id_delete + tags: + - Contact + responses: + 204: + description: 'Contact resource deleted' + 404: + description: 'Resource not found' + summary: 'Removes the Contact resource.' + description: 'Removes the Contact resource.' + parameters: + - + name: id + in: path + description: 'ContactApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + deprecated: false + patch: + operationId: api_contacts_id_patch + tags: + - Contact + responses: + 200: + description: 'Contact resource updated' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Contact.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Contact' + text/html: + schema: + $ref: '#/components/schemas/Contact' + application/hal+json: + schema: + $ref: '#/components/schemas/Contact.jsonhal' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + 404: + description: 'Resource not found' + summary: 'Updates the Contact resource.' + description: 'Updates the Contact resource.' + parameters: + - + name: id + in: path + description: 'ContactApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + requestBody: + description: 'The updated Contact resource' + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/Contact' + required: true + deprecated: false + parameters: [] + /api/media_objects: + get: + operationId: api_media_objects_get_collection + tags: + - MediaObject + responses: + 200: + description: 'MediaObject collection' + content: + application/ld+json: + schema: + type: object + properties: + 'hydra:member': { type: array, items: { $ref: '#/components/schemas/MediaObject.jsonld-media_object.read' } } + 'hydra:totalItems': { type: integer, minimum: 0 } + 'hydra:view': { type: object, properties: { '@id': { type: string, format: iri-reference }, '@type': { type: string }, 'hydra:first': { type: string, format: iri-reference }, 'hydra:last': { type: string, format: iri-reference }, 'hydra:previous': { type: string, format: iri-reference }, 'hydra:next': { type: string, format: iri-reference } }, example: { '@id': string, type: string, 'hydra:first': string, 'hydra:last': string, 'hydra:previous': string, 'hydra:next': string } } + 'hydra:search': { type: object, properties: { '@type': { type: string }, 'hydra:template': { type: string }, 'hydra:variableRepresentation': { type: string }, 'hydra:mapping': { type: array, items: { type: object, properties: { '@type': { type: string }, variable: { type: string }, property: { type: [string, 'null'] }, required: { type: boolean } } } } } } + required: + - 'hydra:member' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MediaObject-media_object.read' + text/html: + schema: + type: array + items: + $ref: '#/components/schemas/MediaObject-media_object.read' + application/hal+json: + schema: + type: object + properties: + _embedded: { type: array, items: { $ref: '#/components/schemas/MediaObject.jsonhal-media_object.read' } } + totalItems: { type: integer, minimum: 0 } + itemsPerPage: { type: integer, minimum: 0 } + _links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } } + required: + - _links + - _embedded + summary: 'Retrieves the collection of MediaObject resources.' + description: 'Retrieves the collection of MediaObject resources.' + parameters: + - + name: page + in: query + description: 'The collection page number' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 1 + style: form + explode: false + allowReserved: false + deprecated: false + post: + operationId: api_media_objects_post + tags: + - MediaObject + responses: + 201: + description: 'MediaObject resource created' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/MediaObject.jsonld-media_object.read' + application/json: + schema: + $ref: '#/components/schemas/MediaObject-media_object.read' + text/html: + schema: + $ref: '#/components/schemas/MediaObject-media_object.read' + application/hal+json: + schema: + $ref: '#/components/schemas/MediaObject.jsonhal-media_object.read' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + summary: 'Creates a MediaObject resource.' + description: 'Creates a MediaObject resource.' + parameters: [] + requestBody: + description: '' + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + required: false + deprecated: false + parameters: [] + '/api/media_objects/{id}': + get: + operationId: api_media_objects_id_get + tags: + - MediaObject + responses: + 200: + description: 'MediaObject resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/MediaObject.jsonld-media_object.read' + application/json: + schema: + $ref: '#/components/schemas/MediaObject-media_object.read' + text/html: + schema: + $ref: '#/components/schemas/MediaObject-media_object.read' + application/hal+json: + schema: + $ref: '#/components/schemas/MediaObject.jsonhal-media_object.read' + 404: + description: 'Resource not found' + summary: 'Retrieves a MediaObject resource.' + description: 'Retrieves a MediaObject resource.' + parameters: + - + name: id + in: path + description: 'MediaObject identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + deprecated: false + parameters: [] + /api/partners: + get: + operationId: api_partners_get_collection + tags: + - Partner + responses: + 200: + description: 'Partner collection' + content: + application/ld+json: + schema: + type: object + properties: + 'hydra:member': { type: array, items: { $ref: '#/components/schemas/Partner.jsonld' } } + 'hydra:totalItems': { type: integer, minimum: 0 } + 'hydra:view': { type: object, properties: { '@id': { type: string, format: iri-reference }, '@type': { type: string }, 'hydra:first': { type: string, format: iri-reference }, 'hydra:last': { type: string, format: iri-reference }, 'hydra:previous': { type: string, format: iri-reference }, 'hydra:next': { type: string, format: iri-reference } }, example: { '@id': string, type: string, 'hydra:first': string, 'hydra:last': string, 'hydra:previous': string, 'hydra:next': string } } + 'hydra:search': { type: object, properties: { '@type': { type: string }, 'hydra:template': { type: string }, 'hydra:variableRepresentation': { type: string }, 'hydra:mapping': { type: array, items: { type: object, properties: { '@type': { type: string }, variable: { type: string }, property: { type: [string, 'null'] }, required: { type: boolean } } } } } } + required: + - 'hydra:member' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Partner' + text/html: + schema: + type: array + items: + $ref: '#/components/schemas/Partner' + application/hal+json: + schema: + type: object + properties: + _embedded: { type: array, items: { $ref: '#/components/schemas/Partner.jsonhal' } } + totalItems: { type: integer, minimum: 0 } + itemsPerPage: { type: integer, minimum: 0 } + _links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } } + required: + - _links + - _embedded + summary: 'Retrieves the collection of Partner resources.' + description: 'Retrieves the collection of Partner resources.' + parameters: + - + name: page + in: query + description: 'The collection page number' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 1 + style: form + explode: false + allowReserved: false + deprecated: false + post: + operationId: api_partners_post + tags: + - Partner + responses: + 201: + description: 'Partner resource created' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Partner.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Partner' + text/html: + schema: + $ref: '#/components/schemas/Partner' + application/hal+json: + schema: + $ref: '#/components/schemas/Partner.jsonhal' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + summary: 'Creates a Partner resource.' + description: 'Creates a Partner resource.' + parameters: [] + requestBody: + description: 'The new Partner resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Partner.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Partner' + text/html: + schema: + $ref: '#/components/schemas/Partner' + application/hal+json: + schema: + $ref: '#/components/schemas/Partner.jsonhal' + required: true + deprecated: false + parameters: [] + '/api/partners/{id}': + get: + operationId: api_partners_id_get + tags: + - Partner + responses: + 200: + description: 'Partner resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Partner.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Partner' + text/html: + schema: + $ref: '#/components/schemas/Partner' + application/hal+json: + schema: + $ref: '#/components/schemas/Partner.jsonhal' + 404: + description: 'Resource not found' + summary: 'Retrieves a Partner resource.' + description: 'Retrieves a Partner resource.' + parameters: + - + name: id + in: path + description: 'PartnerApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + deprecated: false + delete: + operationId: api_partners_id_delete + tags: + - Partner + responses: + 204: + description: 'Partner resource deleted' + 404: + description: 'Resource not found' + summary: 'Removes the Partner resource.' + description: 'Removes the Partner resource.' + parameters: + - + name: id + in: path + description: 'PartnerApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + deprecated: false + patch: + operationId: api_partners_id_patch + tags: + - Partner + responses: + 200: + description: 'Partner resource updated' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Partner.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Partner' + text/html: + schema: + $ref: '#/components/schemas/Partner' + application/hal+json: + schema: + $ref: '#/components/schemas/Partner.jsonhal' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + 404: + description: 'Resource not found' + summary: 'Updates the Partner resource.' + description: 'Updates the Partner resource.' + parameters: + - + name: id + in: path + description: 'PartnerApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + requestBody: + description: 'The updated Partner resource' + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/Partner' + required: true + deprecated: false + parameters: [] + /api/posts: + get: + operationId: api_posts_get_collection + tags: + - Post + responses: + 200: + description: 'Post collection' + content: + application/ld+json: + schema: + type: object + properties: + 'hydra:member': { type: array, items: { $ref: '#/components/schemas/Post.jsonld' } } + 'hydra:totalItems': { type: integer, minimum: 0 } + 'hydra:view': { type: object, properties: { '@id': { type: string, format: iri-reference }, '@type': { type: string }, 'hydra:first': { type: string, format: iri-reference }, 'hydra:last': { type: string, format: iri-reference }, 'hydra:previous': { type: string, format: iri-reference }, 'hydra:next': { type: string, format: iri-reference } }, example: { '@id': string, type: string, 'hydra:first': string, 'hydra:last': string, 'hydra:previous': string, 'hydra:next': string } } + 'hydra:search': { type: object, properties: { '@type': { type: string }, 'hydra:template': { type: string }, 'hydra:variableRepresentation': { type: string }, 'hydra:mapping': { type: array, items: { type: object, properties: { '@type': { type: string }, variable: { type: string }, property: { type: [string, 'null'] }, required: { type: boolean } } } } } } + required: + - 'hydra:member' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Post' + text/html: + schema: + type: array + items: + $ref: '#/components/schemas/Post' + application/hal+json: + schema: + type: object + properties: + _embedded: { type: array, items: { $ref: '#/components/schemas/Post.jsonhal' } } + totalItems: { type: integer, minimum: 0 } + itemsPerPage: { type: integer, minimum: 0 } + _links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } } + required: + - _links + - _embedded + summary: 'Retrieves the collection of Post resources.' + description: 'Retrieves the collection of Post resources.' + parameters: + - + name: page + in: query + description: 'The collection page number' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 1 + style: form + explode: false + allowReserved: false + deprecated: false + post: + operationId: api_posts_post + tags: + - Post + responses: + 201: + description: 'Post resource created' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Post.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Post' + text/html: + schema: + $ref: '#/components/schemas/Post' + application/hal+json: + schema: + $ref: '#/components/schemas/Post.jsonhal' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + summary: 'Creates a Post resource.' + description: 'Creates a Post resource.' + parameters: [] + requestBody: + description: 'The new Post resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Post.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Post' + text/html: + schema: + $ref: '#/components/schemas/Post' + application/hal+json: + schema: + $ref: '#/components/schemas/Post.jsonhal' + required: true + deprecated: false + parameters: [] + '/api/posts/{id}': + get: + operationId: api_posts_id_get + tags: + - Post + responses: + 200: + description: 'Post resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Post.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Post' + text/html: + schema: + $ref: '#/components/schemas/Post' + application/hal+json: + schema: + $ref: '#/components/schemas/Post.jsonhal' + 404: + description: 'Resource not found' + summary: 'Retrieves a Post resource.' + description: 'Retrieves a Post resource.' + parameters: + - + name: id + in: path + description: 'PostingApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + deprecated: false + delete: + operationId: api_posts_id_delete + tags: + - Post + responses: + 204: + description: 'Post resource deleted' + 404: + description: 'Resource not found' + summary: 'Removes the Post resource.' + description: 'Removes the Post resource.' + parameters: + - + name: id + in: path + description: 'PostingApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + deprecated: false + patch: + operationId: api_posts_id_patch + tags: + - Post + responses: + 200: + description: 'Post resource updated' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/Post.jsonld' + application/json: + schema: + $ref: '#/components/schemas/Post' + text/html: + schema: + $ref: '#/components/schemas/Post' + application/hal+json: + schema: + $ref: '#/components/schemas/Post.jsonhal' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + 404: + description: 'Resource not found' + summary: 'Updates the Post resource.' + description: 'Updates the Post resource.' + parameters: + - + name: id + in: path + description: 'PostingApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + requestBody: + description: 'The updated Post resource' + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/Post' + required: true + deprecated: false + parameters: [] + /api/users: + get: + operationId: api_users_get_collection + tags: + - User + responses: + 200: + description: 'User collection' + content: + application/ld+json: + schema: + type: object + properties: + 'hydra:member': { type: array, items: { $ref: '#/components/schemas/User.jsonld' } } + 'hydra:totalItems': { type: integer, minimum: 0 } + 'hydra:view': { type: object, properties: { '@id': { type: string, format: iri-reference }, '@type': { type: string }, 'hydra:first': { type: string, format: iri-reference }, 'hydra:last': { type: string, format: iri-reference }, 'hydra:previous': { type: string, format: iri-reference }, 'hydra:next': { type: string, format: iri-reference } }, example: { '@id': string, type: string, 'hydra:first': string, 'hydra:last': string, 'hydra:previous': string, 'hydra:next': string } } + 'hydra:search': { type: object, properties: { '@type': { type: string }, 'hydra:template': { type: string }, 'hydra:variableRepresentation': { type: string }, 'hydra:mapping': { type: array, items: { type: object, properties: { '@type': { type: string }, variable: { type: string }, property: { type: [string, 'null'] }, required: { type: boolean } } } } } } + required: + - 'hydra:member' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + text/html: + schema: + type: array + items: + $ref: '#/components/schemas/User' + application/hal+json: + schema: + type: object + properties: + _embedded: { type: array, items: { $ref: '#/components/schemas/User.jsonhal' } } + totalItems: { type: integer, minimum: 0 } + itemsPerPage: { type: integer, minimum: 0 } + _links: { type: object, properties: { self: { type: object, properties: { href: { type: string, format: iri-reference } } }, first: { type: object, properties: { href: { type: string, format: iri-reference } } }, last: { type: object, properties: { href: { type: string, format: iri-reference } } }, next: { type: object, properties: { href: { type: string, format: iri-reference } } }, previous: { type: object, properties: { href: { type: string, format: iri-reference } } } } } + required: + - _links + - _embedded + summary: 'Retrieves the collection of User resources.' + description: 'Retrieves the collection of User resources.' + parameters: + - + name: page + in: query + description: 'The collection page number' + required: false + deprecated: false + allowEmptyValue: true + schema: + type: integer + default: 1 + style: form + explode: false + allowReserved: false + deprecated: false + post: + operationId: api_users_post + tags: + - User + responses: + 201: + description: 'User resource created' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/User.jsonld' + application/json: + schema: + $ref: '#/components/schemas/User' + text/html: + schema: + $ref: '#/components/schemas/User' + application/hal+json: + schema: + $ref: '#/components/schemas/User.jsonhal' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + summary: 'Creates a User resource.' + description: 'Creates a User resource.' + parameters: [] + requestBody: + description: 'The new User resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/User.jsonld' + application/json: + schema: + $ref: '#/components/schemas/User' + text/html: + schema: + $ref: '#/components/schemas/User' + application/hal+json: + schema: + $ref: '#/components/schemas/User.jsonhal' + required: true + deprecated: false + parameters: [] + '/api/users/{id}': + get: + operationId: api_users_id_get + tags: + - User + responses: + 200: + description: 'User resource' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/User.jsonld' + application/json: + schema: + $ref: '#/components/schemas/User' + text/html: + schema: + $ref: '#/components/schemas/User' + application/hal+json: + schema: + $ref: '#/components/schemas/User.jsonhal' + 404: + description: 'Resource not found' + summary: 'Retrieves a User resource.' + description: 'Retrieves a User resource.' + parameters: + - + name: id + in: path + description: 'UserApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + deprecated: false + patch: + operationId: api_users_id_patch + tags: + - User + responses: + 200: + description: 'User resource updated' + content: + application/ld+json: + schema: + $ref: '#/components/schemas/User.jsonld' + application/json: + schema: + $ref: '#/components/schemas/User' + text/html: + schema: + $ref: '#/components/schemas/User' + application/hal+json: + schema: + $ref: '#/components/schemas/User.jsonhal' + links: { } + 400: + description: 'Invalid input' + 422: + description: 'Unprocessable entity' + 404: + description: 'Resource not found' + summary: 'Updates the User resource.' + description: 'Updates the User resource.' + parameters: + - + name: id + in: path + description: 'UserApi identifier' + required: true + deprecated: false + allowEmptyValue: false + schema: + type: string + style: simple + explode: false + allowReserved: false + requestBody: + description: 'The updated User resource' + content: + application/merge-patch+json: + schema: + $ref: '#/components/schemas/User' + required: true + deprecated: false + parameters: [] + /auth: + post: + operationId: login_check_post + tags: + - 'Login Check' + responses: + 200: + description: 'User token created' + content: + application/json: + schema: + type: object + properties: + token: { readOnly: true, type: string, nullable: false } + required: + - token + summary: 'Creates a user token.' + description: 'Creates a user token.' + requestBody: + description: 'The login data' + content: + application/json: + schema: + type: object + properties: + email: + type: string + nullable: false + password: + type: string + nullable: false + required: + - email + - password + required: true + parameters: [] +components: + schemas: + Contact: + type: object + description: '' + deprecated: false + required: + - firstName + - lastName + properties: + firstName: + type: + - string + - 'null' + lastName: + type: + - string + - 'null' + partner: + anyOf: + - + $ref: '#/components/schemas/Partner' + - + type: 'null' + birthday: + type: + - string + - 'null' + format: date-time + image: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + position: + type: + - string + - 'null' + phone: + type: + - string + - 'null' + email: + type: + - string + - 'null' + createdAt: + type: + - string + - 'null' + format: date-time + Contact.jsonhal: + type: object + description: '' + deprecated: false + required: + - firstName + - lastName + properties: + _links: + type: object + properties: + self: + type: object + properties: + href: + type: string + format: iri-reference + firstName: + type: + - string + - 'null' + lastName: + type: + - string + - 'null' + partner: + anyOf: + - + $ref: '#/components/schemas/Partner.jsonhal' + - + type: 'null' + birthday: + type: + - string + - 'null' + format: date-time + image: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + position: + type: + - string + - 'null' + phone: + type: + - string + - 'null' + email: + type: + - string + - 'null' + createdAt: + type: + - string + - 'null' + format: date-time + Contact.jsonld: + type: object + description: '' + deprecated: false + required: + - firstName + - lastName + properties: + '@context': + readOnly: true + oneOf: + - + type: string + - + type: object + properties: + '@vocab': + type: string + hydra: + type: string + enum: ['http://www.w3.org/ns/hydra/core#'] + required: + - '@vocab' + - hydra + additionalProperties: true + '@id': + readOnly: true + type: string + '@type': + readOnly: true + type: string + firstName: + type: + - string + - 'null' + lastName: + type: + - string + - 'null' + partner: + anyOf: + - + $ref: '#/components/schemas/Partner.jsonld' + - + type: 'null' + birthday: + type: + - string + - 'null' + format: date-time + image: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + position: + type: + - string + - 'null' + phone: + type: + - string + - 'null' + email: + type: + - string + - 'null' + createdAt: + type: + - string + - 'null' + format: date-time + MediaObject-media_object.read: + type: object + description: '' + deprecated: false + externalDocs: + url: 'https://schema.org/MediaObject' + properties: + contentUrl: + externalDocs: + url: 'https://schema.org/contentUrl' + type: + - string + - 'null' + MediaObject.jsonhal-media_object.read: + type: object + description: '' + deprecated: false + externalDocs: + url: 'https://schema.org/MediaObject' + properties: + _links: + type: object + properties: + self: + type: object + properties: + href: + type: string + format: iri-reference + contentUrl: + externalDocs: + url: 'https://schema.org/contentUrl' + type: + - string + - 'null' + MediaObject.jsonld-media_object.read: + type: object + description: '' + deprecated: false + externalDocs: + url: 'https://schema.org/MediaObject' + properties: + '@context': + readOnly: true + oneOf: + - + type: string + - + type: object + properties: + '@vocab': + type: string + hydra: + type: string + enum: ['http://www.w3.org/ns/hydra/core#'] + required: + - '@vocab' + - hydra + additionalProperties: true + '@id': + readOnly: true + type: string + '@type': + readOnly: true + type: string + contentUrl: + externalDocs: + url: 'https://schema.org/contentUrl' + type: + - string + - 'null' + Partner: + type: object + description: '' + deprecated: false + properties: + id: + readOnly: true + type: integer + name: + type: string + type: + type: string + enum: + - customer + - supplier + - service + street: + type: + - string + - 'null' + streetNo: + type: + - string + - 'null' + zip: + type: + - string + - 'null' + city: + type: + - string + - 'null' + country: + type: + - string + - 'null' + website: + type: + - string + - 'null' + createdAt: + type: string + format: date-time + contacts: + type: array + items: + $ref: '#/components/schemas/Contact' + logo: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + Partner.jsonhal: + type: object + description: '' + deprecated: false + properties: + _links: + type: object + properties: + self: + type: object + properties: + href: + type: string + format: iri-reference + id: + readOnly: true + type: integer + name: + type: string + type: + type: string + enum: + - customer + - supplier + - service + street: + type: + - string + - 'null' + streetNo: + type: + - string + - 'null' + zip: + type: + - string + - 'null' + city: + type: + - string + - 'null' + country: + type: + - string + - 'null' + website: + type: + - string + - 'null' + createdAt: + type: string + format: date-time + contacts: + type: array + items: + $ref: '#/components/schemas/Contact.jsonhal' + logo: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + Partner.jsonld: + type: object + description: '' + deprecated: false + properties: + '@context': + readOnly: true + oneOf: + - + type: string + - + type: object + properties: + '@vocab': + type: string + hydra: + type: string + enum: ['http://www.w3.org/ns/hydra/core#'] + required: + - '@vocab' + - hydra + additionalProperties: true + '@id': + readOnly: true + type: string + '@type': + readOnly: true + type: string + id: + readOnly: true + type: integer + name: + type: string + type: + type: string + enum: + - customer + - supplier + - service + street: + type: + - string + - 'null' + streetNo: + type: + - string + - 'null' + zip: + type: + - string + - 'null' + city: + type: + - string + - 'null' + country: + type: + - string + - 'null' + website: + type: + - string + - 'null' + createdAt: + type: string + format: date-time + contacts: + type: array + items: + $ref: '#/components/schemas/Contact.jsonld' + logo: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + Post: + type: object + description: '' + deprecated: false + required: + - message + properties: + message: + type: + - string + - 'null' + owner: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + createdAt: + readOnly: true + type: + - string + - 'null' + format: date-time + Post.jsonhal: + type: object + description: '' + deprecated: false + required: + - message + properties: + _links: + type: object + properties: + self: + type: object + properties: + href: + type: string + format: iri-reference + message: + type: + - string + - 'null' + owner: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + createdAt: + readOnly: true + type: + - string + - 'null' + format: date-time + Post.jsonld: + type: object + description: '' + deprecated: false + required: + - message + properties: + '@context': + readOnly: true + oneOf: + - + type: string + - + type: object + properties: + '@vocab': + type: string + hydra: + type: string + enum: ['http://www.w3.org/ns/hydra/core#'] + required: + - '@vocab' + - hydra + additionalProperties: true + '@id': + readOnly: true + type: string + '@type': + readOnly: true + type: string + message: + type: + - string + - 'null' + owner: + 'owl:maxCardinality': 1 + type: + - string + - 'null' + format: iri-reference + example: 'https://example.com/' + createdAt: + readOnly: true + type: + - string + - 'null' + format: date-time + User: + type: object + description: '' + deprecated: false + required: + - email + - firstName + - lastName + properties: + email: + format: email + externalDocs: + url: 'https://schema.org/email' + type: + - string + - 'null' + firstName: + type: + - string + - 'null' + lastName: + type: + - string + - 'null' + password: + writeOnly: true + description: 'The plaintext password when being set or changed.' + type: + - string + - 'null' + active: + type: boolean + createdAt: + readOnly: true + type: + - string + - 'null' + format: date-time + postings: + type: array + items: + type: string + format: iri-reference + example: 'https://example.com/' + User.jsonhal: + type: object + description: '' + deprecated: false + required: + - email + - firstName + - lastName + properties: + _links: + type: object + properties: + self: + type: object + properties: + href: + type: string + format: iri-reference + email: + format: email + externalDocs: + url: 'https://schema.org/email' + type: + - string + - 'null' + firstName: + type: + - string + - 'null' + lastName: + type: + - string + - 'null' + password: + writeOnly: true + description: 'The plaintext password when being set or changed.' + type: + - string + - 'null' + active: + type: boolean + createdAt: + readOnly: true + type: + - string + - 'null' + format: date-time + postings: + type: array + items: + type: string + format: iri-reference + example: 'https://example.com/' + User.jsonld: + type: object + description: '' + deprecated: false + required: + - email + - firstName + - lastName + properties: + '@context': + readOnly: true + oneOf: + - + type: string + - + type: object + properties: + '@vocab': + type: string + hydra: + type: string + enum: ['http://www.w3.org/ns/hydra/core#'] + required: + - '@vocab' + - hydra + additionalProperties: true + '@id': + readOnly: true + type: string + '@type': + readOnly: true + type: string + email: + format: email + externalDocs: + url: 'https://schema.org/email' + type: + - string + - 'null' + firstName: + type: + - string + - 'null' + lastName: + type: + - string + - 'null' + password: + writeOnly: true + description: 'The plaintext password when being set or changed.' + type: + - string + - 'null' + active: + type: boolean + createdAt: + readOnly: true + type: + - string + - 'null' + format: date-time + postings: + type: array + items: + type: string + format: iri-reference + example: 'https://example.com/' + responses: { } + parameters: { } + examples: { } + requestBodies: { } + headers: { } + securitySchemes: + JWT: + type: http + scheme: bearer + bearerFormat: JWT +security: + - + JWT: [] +tags: [] + diff --git a/src/ApiResource/PartnerApi.php b/src/ApiResource/PartnerApi.php index 86e684e..c5ea2b6 100644 --- a/src/ApiResource/PartnerApi.php +++ b/src/ApiResource/PartnerApi.php @@ -7,7 +7,9 @@ namespace App\ApiResource; +use ApiPlatform\Doctrine\Odm\Filter\OrderFilter; use ApiPlatform\Doctrine\Orm\State\Options; +use ApiPlatform\Metadata\ApiFilter; use ApiPlatform\Metadata\ApiProperty; use ApiPlatform\Metadata\ApiResource; use App\Entity\MediaObject; @@ -45,6 +47,7 @@ use Symfony\Component\Validator\Constraints\NotBlank; processor: EntityClassDtoStateProcessor::class, stateOptions: new Options(entityClass: Partner::class), )] +#[ApiFilter(OrderFilter::class, properties: ['name'], arguments: ['orderParameterName' => 'order'])] class PartnerApi { #[ApiProperty(readable: false, writable: false, identifier: true)] diff --git a/src/Mapper/PartnerApiToEntityMapper.php b/src/Mapper/PartnerApiToEntityMapper.php index 5229a31..8c0bfda 100644 --- a/src/Mapper/PartnerApiToEntityMapper.php +++ b/src/Mapper/PartnerApiToEntityMapper.php @@ -49,6 +49,7 @@ class PartnerApiToEntityMapper implements MapperInterface assert($entity instanceof Partner); $entity->setName($dto->name); + $entity->setType($dto->type); $entity->setStreet($dto->street); $entity->setStreetNo($dto->streetNo); $entity->setZip($dto->zip);