Git Product home page Git Product logo

Comments (4)

tschaffter avatar tschaffter commented on August 27, 2024

Do you remember when I mentioned that I was considering creating two schemas to solve the issue where a property should be part of the input and not the output or vice versa? OpenAPI options readOnly and writeOnly intend to solve this problem in a DRY way.

The problem that you report is actually due to connexion-Flask not respecting the option readOnly and writeOnly when generating examples of request bodies. Here id is marked as readOnly and so should only be included in output objects. You can confirm this by looking at the schema of the request body where id is not included.

image

Here is what OpenApi doc says for readOnly:

Relevant only for Schema "properties" definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but SHOULD NOT be sent as part of the request. If the property is marked as readOnly being true and is in the required list, the required will take effect on the response only. A property MUST NOT be marked as both readOnly and writeOnly being true. Default value is false.

Note the use of "SHOULD NOT" and not "MUST NOT" in "SHOULD NOT be sent as part of the request". This means that connexion-Flask should not throw an error if a property marked as readOnly is included in the request body.

See nlpsandbox/data-node#81

Open discussion in connexion project:
spec-first/connexion#942
spec-first/connexion#350

The solution described here as part of 942 complicates the code too much and I don't want this to confuse our developers since we provide this code as example.

from nlpsandbox-schemas.

tschaffter avatar tschaffter commented on August 27, 2024

Open tickets for OpenAPITools/openapi-generator:
OpenAPITools/openapi-generator#4190

from nlpsandbox-schemas.

thomasyu888 avatar thomasyu888 commented on August 27, 2024

The resolution is that 'id' needs to be removed from clinical notes prior to annotation.

from nlpsandbox-schemas.

github-actions avatar github-actions commented on August 27, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from nlpsandbox-schemas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.