Skip to content

Commit

Permalink
OData V2 type Edm.Time (#303)
Browse files Browse the repository at this point in the history
* xslt: test case for Edm.Time
* Edm.Time for OData V2
* bump dependencies
* Update CHANGELOG.md
* bump version to 0.26.0
  • Loading branch information
ralfhandl authored Jul 4, 2024
1 parent 3c9b54d commit d00aabe
Show file tree
Hide file tree
Showing 8 changed files with 825 additions and 263 deletions.
62 changes: 34 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## [0.25.0] - 2024-01-12
## 0.26.0 - 2024-01-12

### Added

- OData V2 type `Edm.Time` now supported

## 0.25.0 - 2024-01-12

### Added

Expand All @@ -11,31 +17,31 @@
- Deep paths to stubbed entity types are omitted.
- The `/$batch` resource is omitted.

## [0.24.2] - 2024-01-16
## 0.24.2 - 2024-01-16

### Fixed

- Action/function imports referencing unknown actions/functions are ignored

## [0.24.1] - 2023-12-20
## 0.24.1 - 2023-12-20

### Fixed

- Complex types were sometimes wrongly colored in diagrams

## [0.24.0] - 2023-11-07
## 0.24.0 - 2023-11-07

### Added

- Core.ComputedDefaultValue means property is not required on create

## [0.23.4] - 2023-08-16
## 0.23.4 - 2023-08-16

### Fixed

- OData V2 EntitySet elements may have Documentation child elements

## [0.23.3] - 2023-06-30
## 0.23.3 - 2023-06-30

### Added

Expand All @@ -45,138 +51,138 @@

- Reduced default maximum level of containment navigation properties from 5 to 4

## [0.23.2] - 2023-06-16
## 0.23.2 - 2023-06-16

### Fixed

- Inheritance across schemas is now correctly processed

## [0.23.1] - 2023-06-15
## 0.23.1 - 2023-06-15

### Fixed

- Annotations for model elements on other schemas are now correctly processed

## [0.23.0] - 2023-03-31
## 0.23.0 - 2023-03-31

### Changed

- Edm.Decimal with floating scale and precision 34 uses the newly registered OpenAPI format [`decimal128`](https://spec.openapis.org/registry/format/decimal128.html)
- Edm.Binary and Edm.Stream in OpenAPI 3.1 use [`contentEncoding`](https://json-schema.org/draft/2020-12/json-schema-validation.html#name-contentencoding) with a value of `base64url`.

## [0.22.0] - 2023-03-21
## 0.22.0 - 2023-03-21

### Changed

- Refactored code without functional changes, added `exports` in `package.json` to prevent unintended use of package-internal modules

## [0.21.4] - 2023-03-14
## 0.21.4 - 2023-03-14

### Added

- Add cli support for a default title if none is annotated using `--title`
- Add cli support for a default description if none is annotated using `--description`, works with diagram

## [0.21.3] - 2023-03-10
## 0.21.3 - 2023-03-10

### Changed

- Path templates for decimal key properties in parentheses now correctly do not have the single quotes

## [0.21.0] - 2023-02-23
## 0.21.0 - 2023-02-23

### Added

- Support to skip the `$batch` path using the CLI parameter `--skipBatchPath`, it will skip the generation always

## [0.20.0] - 2023-01-12
## 0.20.0 - 2023-01-12

### Added

- Support for `FilterSegmentSupported` property of [`UpdateRestrictions`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#updaterestrictionstype) and [`DeleteRestrictions`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.md#deleterestrictionstype)

## [0.19.0] - 2022-10-08
## 0.19.0 - 2022-10-08

### Added

- Support for OData V2

## [0.18.3] - 2022-09-01
## 0.18.3 - 2022-09-01

### Added

- Use [stringifyStream](https://www.npmjs.com/package/@discoveryjs/json-ext) for generating JSON

## [0.18.0] - 2022-06-01
## 0.18.0 - 2022-06-01

### Added

- Dynamic capabilities using `Path=`(XML) or `$Path` (JSON) are now treated as `true`

## [0.17.0] - 2022-05-19
## 0.17.0 - 2022-05-19

### Added

- Define operation-specific HTTP error response status codes with descriptions via `ErrorResponses` property of certain annotations

## [0.16.0] - 2022-04-11
## 0.16.0 - 2022-04-11

### Added

- Option `-o` / `--openapi-version` to set the OpenAPI version - version will be used for `openapi` output property without checks.
- Support for OpenAPI version 3.1.0.
- Recognize namespace-qualified annotations without vocabulary reference

## [0.15.0] - 2022-03-28
## 0.15.0 - 2022-03-28

### Added

- Schema for custom headers and custom query options with annotation `JSON.Schema`.
- Schema for action/function parameters with annotation `JSON.Schema`.

## [0.14.0] - 2022-03-15
## 0.14.0 - 2022-03-15

### Added

- `Capabilities.UpdateMethod` to use for example `PUT` instead of `PATCH`.

## [0.13.0] - 2022-03-14
## 0.13.0 - 2022-03-14

### Added

- Custom headers and custom query options, see example [`custom-parameters.xml`](./examples/custom-parameters.xml) and its output [`custom-parameters.openapi3.json`](./examples/custom-parameters.openapi3.json).

## [0.12.0] - 2022-02-28
## 0.12.0 - 2022-02-28

### Changed

- Path templates for function parameters in parentheses within the path part now exclude the single quotes that are required for e.g. `Edm.String` values. Instead the quotes have to be provided in the parameter value. This "breaking" change is necessary to allow null values and empty string values as function parameters.

## [0.11.2] - 2022-02-25
## 0.11.2 - 2022-02-25

### Added

- Non-trivial action and function import parameters are now depicted in the diagram.

## [0.11.1] - 2022-02-21
## 0.11.1 - 2022-02-21

### Fixed

- External annotations targeting a function overload with collection-valued parameters are now correctly recognized.

## [0.11.0] - 2021-11-22
## 0.11.0 - 2021-11-22

### Added

- Schemas for create allow linking to existing entities for single-valued non-nullable non-containment navigation properties.

## [0.10.0] - 2021-10-22
## 0.10.0 - 2021-10-22

### Changed

- Paths for bound actions and functions only on entity sets, singletons, and containment navigation properties.

## [0.9.0] - 2021-10-13
## 0.9.0 - 2021-10-13

### Changed

Expand Down
11 changes: 11 additions & 0 deletions lib/csdl2openapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -2632,6 +2632,17 @@ module.exports.csdl2openapi = function (
allowedValues(s, element);
pattern(s, element);
break;
case "Edm.Time":
s = {
type: "string",
example:
"PT15H51M04" +
(isNaN(element.$Precision) || element.$Precision === 0
? ""
: "." + "0".repeat(element.$Precision)) +
"S",
};
break;
case "Edm.TimeOfDay":
s = {
type: "string",
Expand Down
Loading

0 comments on commit d00aabe

Please sign in to comment.