Patrick a59bd84e41 feat(oas) - accurate model OAS representation - PA to PU (#3223)
### Scope

Models PA to PU

### What

Refactor OAS for models to accurately represent their shape in API responses.

### Why

About 33% of model fields are not accurately represented in the OAS. Most of the issues are:
- fields that can not be omitted in the response are not declared as `required`
- fields that could return `null` as their value are not declared as `nullable: true`

When using a code generator, these OAS issues would lead to inaccurate response shapes in the generated client.

### How

#### nullable
Fields meeting at least one of the following condition will be represented as `nullable: true` in OAS:
* The field is decorated with `@Column({ nullable: true })`
* The field is decorated with `@OneToOne`, `@ManyToOne`
* The field is decorated with `@DeleteDateColumn`

#### optional
Fields meeting at least one of the following conditions will never be listed as `required` in OAS and will be considered optional and could be omitted in the response:
* The field is decorated with `@OneToOne`, `@ManyToOne`, `@OneToMany`, `@ManyToMany`
* The field is decorated with `@FeatureFlagColumn`
* The field is decorated with `@Column({select: false})`
* The field is representing dynamic values not persisted in the database

Fields not meeting any of the conditions above will be declared as `required` and are expected to be present in the response.

### Test
* Ran OAS validator.
* Ran docs build script.

Expect OAS changes to be reflected in the API documentation.
2023-02-10 15:35:24 +00:00
2021-10-12 22:10:36 +02:00
2021-06-15 15:45:59 +02:00
2022-08-29 13:26:58 +00:00
2021-12-07 11:02:35 +01:00
2020-09-09 09:24:51 +02:00
2022-02-15 13:44:23 +01:00
2021-07-04 20:08:55 +01:00
2022-01-06 13:05:04 +01:00
2023-02-08 19:35:44 +01:00

Medusa

Medusa

Documentation | Medusa Admin Demo | Website

An open source composable commerce engine built for developers.

Medusa is released under the MIT license. Current CircleCI build status. PRs welcome! Product Hunt Discord Chat Follow @medusajs

Getting Started

Follow our quickstart guide to learn how to set up a Medusa server.

Requirements

You can check out this documentation for details about setting up your environment.

What is Medusa

Medusa is an open source composable commerce engine built with Node.js. Medusa enables developers to build scalable and sophisticated commerce setups with low effort and great developer experience.

You can learn more about Medusas architecture in our documentation.

Features

You can learn about all of the ecommerce features that Medusa provides in our documentation.

Roadmap

You can view our roadmap with features that are planned, started, and completed on the Roadmap discussion category.

Plugins

Check out our available plugins that you can install and use instantly on your Medusa server.

Contributions

Please check our contribution guide for details about how to contribute to both our codebase and our documentation.

Upgrade Guides

Follow our upgrade guides on the documentation to keep your Medusa project up-to-date.

Community & Support

Use these channels to be part of the community, ask for help while using Medusa, or just learn more about Medusa:

  • Discord: This is the main channel to join the community. You can ask for help, showcase your work with Medusa, and stay up to date with everything Medusa.
  • GitHub Issues: for sending in any issues you face or bugs you find while using Medusa.
  • GitHub Discussions: for joining discussions and submitting your ideas.
  • Medusa Blog: find diverse tutorials and company news.
  • Twitter
  • LinkedIn

License

Licensed under the MIT License

Description
No description provided
Readme 539 MiB
Languages
TypeScript 84.9%
JavaScript 14.8%
Shell 0.2%