Skip to content

Properly deserialize ref requestBodies in v2 #932

Closed

Description

Below is what the current serialization yields:

# omitted
paths:
  '/Documents({Id})/Revisions/$ref'
      post:
            tags:
              - Documents.RevisionDto
            summary: Create new navigation property ref to Revisions for Documents
            operationId: Documents.CreateRefRevisions
            consumes: [ ]
            parameters:
              - in: path
                name: Id
                description: 'key: Id of DocumentDto'
                required: true
                type: integer
                format: int32
                maximum: 2147483647
                minimum: -2147483648
                x-ms-docs-key-type: DocumentDto
              - in: body
                name: body
                schema: { }
            responses:
              '204':
                description: Success
              default:
                $ref: '#/responses/error'
            x-ms-docs-operation-type: operation
definitions:
  ReferenceCreate:
      type: object
      properties:
        '@odata.id':
          type: string
      additionalProperties:
        type: object
  

Expected result:

# omitted
paths:
  '/Documents({Id})/Revisions/$ref'
      post:
            tags:
              - Documents.RevisionDto
            summary: Create new navigation property ref to Revisions for Documents
            operationId: Documents.CreateRefRevisions
            consumes: 
              - application/json
            parameters:
              - in: path
                name: Id
                description: 'key: Id of DocumentDto'
                required: true
                type: integer
                format: int32
                maximum: 2147483647
                minimum: -2147483648
                x-ms-docs-key-type: DocumentDto
              - $ref: '#/parameters/refPostBody'
            responses:
              '204':
                description: Success
              default:
                $ref: '#/responses/error'
            x-ms-docs-operation-type: operation
parameters:
    refPostBody:
        in: body
        name: body
        description: New navigation property ref value
        required: true
        schema:
          $ref: '#/definitions/ReferenceCreate'

Activity

  1. changed the title [-]Properly handle ref requestBodies[/-] [+]Properly deserialize ref requestBodies in v2[/+] on Jul 6, 2022
  2. added
    type:bugA broken experience
    priority:p2Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 days
    on Jul 6, 2022
  3. added this to the NET:1.3 milestone on Jul 6, 2022
  4. darrelmiller commented on Jul 6, 2022

    @darrelmiller
    Member

    requestBodies is not a valid property of a OpenAPI 2.0 document https://spec.openapis.org/oas/v2.0.html#fixed-fields

    The expected result as shown above is not correct.

    The problem with the original document is the most likely related to the empty consumes array. This is a bug that I fixed yesterday #926

  5. millicentachieng commented on Jul 6, 2022

    @millicentachieng
    ContributorAuthor

    Darrel (@darrelmiller), thank you for pointing that out. I'll be testing with your changes and then report back.

  6. darrelmiller commented on Jul 15, 2022

    @darrelmiller
    Member
  7. millicentachieng commented on Jul 18, 2022

    @millicentachieng
    ContributorAuthor

    Millicent Achieng (@millicentachieng) Can we close this?
    Yes. Closing...

  8. millicentachieng commented on Oct 6, 2022

    @millicentachieng
    ContributorAuthor

    Related #1033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

priority:p2Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 daystype:bugA broken experience

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions