implemented first /sample methods
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
			
		||||
/samples:
 | 
			
		||||
  get:
 | 
			
		||||
    summary: TODO all samples in overview
 | 
			
		||||
    summary: all samples in overview
 | 
			
		||||
    description: 'Auth: all, levels: read, write, maintain, dev, admin'
 | 
			
		||||
    tags:
 | 
			
		||||
      - /sample
 | 
			
		||||
@@ -10,7 +10,9 @@
 | 
			
		||||
        content:
 | 
			
		||||
          application/json:
 | 
			
		||||
            schema:
 | 
			
		||||
              $ref: 'api.yaml#/components/schemas/Samples'
 | 
			
		||||
              type: array
 | 
			
		||||
              items:
 | 
			
		||||
                $ref: 'api.yaml#/components/schemas/SampleRefs'
 | 
			
		||||
      401:
 | 
			
		||||
        $ref: 'api.yaml#/components/responses/401'
 | 
			
		||||
      500:
 | 
			
		||||
@@ -39,7 +41,7 @@
 | 
			
		||||
      500:
 | 
			
		||||
        $ref: 'api.yaml#/components/responses/500'
 | 
			
		||||
  put:
 | 
			
		||||
    summary: TODO add/change sample
 | 
			
		||||
    summary: TODO change sample
 | 
			
		||||
    description: 'Auth: basic, levels: write, maintain, dev, admin'
 | 
			
		||||
    tags:
 | 
			
		||||
      - /sample
 | 
			
		||||
@@ -88,10 +90,41 @@
 | 
			
		||||
        $ref: 'api.yaml#/components/responses/404'
 | 
			
		||||
      500:
 | 
			
		||||
        $ref: 'api.yaml#/components/responses/500'
 | 
			
		||||
 | 
			
		||||
/sample/new:
 | 
			
		||||
  post:
 | 
			
		||||
    summary: add sample
 | 
			
		||||
    description: 'Auth: basic, levels: write, maintain, dev, admin'
 | 
			
		||||
    tags:
 | 
			
		||||
      - /sample
 | 
			
		||||
    security:
 | 
			
		||||
      - BasicAuth: []
 | 
			
		||||
    requestBody:
 | 
			
		||||
      required: true
 | 
			
		||||
      content:
 | 
			
		||||
        application/json:
 | 
			
		||||
          schema:
 | 
			
		||||
            $ref: 'api.yaml#/components/schemas/Sample'
 | 
			
		||||
    responses:
 | 
			
		||||
      200:
 | 
			
		||||
        description: samples details
 | 
			
		||||
        content:
 | 
			
		||||
          application/json:
 | 
			
		||||
            schema:
 | 
			
		||||
              $ref: 'api.yaml#/components/schemas/SampleRefs'
 | 
			
		||||
      400:
 | 
			
		||||
        $ref: 'api.yaml#/components/responses/400'
 | 
			
		||||
      401:
 | 
			
		||||
        $ref: 'api.yaml#/components/responses/401'
 | 
			
		||||
      403:
 | 
			
		||||
        $ref: 'api.yaml#/components/responses/403'
 | 
			
		||||
      500:
 | 
			
		||||
        $ref: 'api.yaml#/components/responses/500'
 | 
			
		||||
 | 
			
		||||
/sample/notes/fields:
 | 
			
		||||
  get:
 | 
			
		||||
    summary: TODO list all existing field names for custom notes fields
 | 
			
		||||
    description: 'Auth: all, levels: write, maintain, dev, admin'
 | 
			
		||||
    description: 'Auth: all, levels: read, write, maintain, dev, admin'
 | 
			
		||||
    tags:
 | 
			
		||||
      - /sample
 | 
			
		||||
    responses:
 | 
			
		||||
 
 | 
			
		||||
@@ -14,16 +14,17 @@ Color:
 | 
			
		||||
      example: black
 | 
			
		||||
SampleProperties:
 | 
			
		||||
  properties:
 | 
			
		||||
    sample_number:
 | 
			
		||||
    number:
 | 
			
		||||
      type: string
 | 
			
		||||
      example: Rng172
 | 
			
		||||
    type:
 | 
			
		||||
      type: string
 | 
			
		||||
      example: granulate
 | 
			
		||||
    batch:
 | 
			
		||||
      type: string
 | 
			
		||||
    validated:
 | 
			
		||||
      type: boolean
 | 
			
		||||
      example: 1560237365
 | 
			
		||||
 | 
			
		||||
Samples:
 | 
			
		||||
SampleRefs:
 | 
			
		||||
  allOf:
 | 
			
		||||
    - $ref: 'api.yaml#/components/schemas/_Id'
 | 
			
		||||
    - $ref: 'api.yaml#/components/schemas/Color'
 | 
			
		||||
@@ -41,17 +42,23 @@ Sample:
 | 
			
		||||
    - $ref: 'api.yaml#/components/schemas/Color'
 | 
			
		||||
    - $ref: 'api.yaml#/components/schemas/SampleProperties'
 | 
			
		||||
  properties:
 | 
			
		||||
    material:
 | 
			
		||||
      $ref: 'api.yaml#/components/schemas/Material'
 | 
			
		||||
    material_id:
 | 
			
		||||
      allOf:
 | 
			
		||||
        - $ref: 'api.yaml#/components/schemas/Id'
 | 
			
		||||
    notes:
 | 
			
		||||
      type: object
 | 
			
		||||
      properties:
 | 
			
		||||
        comments:
 | 
			
		||||
        comment:
 | 
			
		||||
          type: string
 | 
			
		||||
        sample_references:
 | 
			
		||||
          type: array
 | 
			
		||||
          items:
 | 
			
		||||
            $ref: 'api.yaml#/components/schemas/Id'
 | 
			
		||||
            properties:
 | 
			
		||||
              id:
 | 
			
		||||
                $ref: 'api.yaml#/components/schemas/Id'
 | 
			
		||||
              relation:
 | 
			
		||||
                type: string
 | 
			
		||||
                example: part to this sample
 | 
			
		||||
SampleDetail:
 | 
			
		||||
  allOf:
 | 
			
		||||
    - $ref: 'api.yaml#/components/schemas/_Id'
 | 
			
		||||
@@ -63,7 +70,7 @@ SampleDetail:
 | 
			
		||||
    notes:
 | 
			
		||||
      type: object
 | 
			
		||||
      properties:
 | 
			
		||||
        comments:
 | 
			
		||||
        comment:
 | 
			
		||||
          type: string
 | 
			
		||||
        sample_references:
 | 
			
		||||
          type: array
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user