Releases: aml-org/amf
Changes in AMF 5.2.6
What's Changed
- Add tracked element annotation to shape serializable annotation index by @pope1838 in #1734
- W-11802973: add warning when using a JSON Schema in type expressions by @arielmirra in #1733
- W-12587175: union shouldn't propagate custom domain properties to its members by @tomsfernandez in #1732
- Bump org.json.json to 20230227 by @looseale in #1745
- W-11802973: check discriminator usage in inline schemas by @arielmirra in #1747
- W-11460908 [fix regression]: parsing & validating discriminator value as a DataNode in the model by @nschejtman in #1752
- Update Dockerfile by @tomsfernandez in #1759
Full Changelog: 5.2.5...5.2.6
Changes in AMF 5.2.5
What's Changed
- Add typing for grpc configuration by @pope1838 in #1717
- (fix): properties with same semantics but different sub tree weren't being merged by @tomsfernandez in #1718
- W-12438860: syntax recovery by @nschejtman in #1725
- W-12385375: refactor getDeclaringUnit logic to improve performance by @nschejtman in #1726
- W-11351848: added discrminator value validation candidate collector by @nschejtman in #1727
- W-12361132 (fix): removed ast tampering in and, or and xone parsers by @tomsfernandez in #1729
- W-12521486: fixed wrong type expression parsing by @tomsfernandez in #1728
- W-11680259: avoid throwing remote context error in canParse method by @arielmirra in #1730
- update typings with JSONLD features by @arielmirra in #1739
Important validation - New RAML type validation
When a raml type has the value type: []
we now validate it with the message [] is not a valid type
.
For example in the following API:
/test:
post:
body:
application/json:
properties:
products: []
The type of products
is not valid, and the validation [] is not a valid type
will show up.
Full Changelog: 5.2.4...5.2.5
Changes in AMF 5.2.4
What's Changed
- W-12150964: add annotations in graphql parsing by @arielmirra in #1694
- Fix client list at jsonld object interfaces by @pope1838 in #1698
- W-12348272: fix HasShapeFederationMetadata interface change by @nschejtman in #1700
- Register jsonldobject wrapper in platform at jsonld configuration by @pope1838 in #1703
- W-11757246/fail-fast-json-schema-plugin by @tomsfernandez in #1696
- Fix repo name in JenkinsFile by @looseale in #1707
- W 12292129 by @damianpedra in #1708
- (fix): removed DefaultShaclOptions as it isn't used by @tomsfernandez in #1709
- Add jsonld instance rendering by syntax, using terms names without lo… by @pope1838 in #1711
- W-11460908: update dialect snapshots by @arielmirra in #1712
- fix import in JsoLDSchemaResult and add a new converter by @damianpedra in #1710
- W-12355752: add lexical to virtual elements in editing pipeline by @arielmirra in #1713
- modify imports from scala to Platform by @damianpedra in #1714
- W-12276263 - Created parsing plugin and extracted common methods by @looseale in #1715
- W-12362160 - Added pattern properties support for JSON-LD Schema by @looseale in #1716
- update typings with JSONLD features by @arielmirra in #1721
Full Changelog: 5.2.3...5.2.4
5.2.3
Validation Changes
The RAML validation to detect a conflict between queryString and queryParameter was moved from parsing to validation stage, and now it also detects if the conflict is originated after applying a trait.
What's Changed
- Import fully qualyfied static method at hacked json object parser by @pope1838 in #1673
- W-12111901 by @hghianni in #1672
- W-11818372: Fix ref from definition to another definition not resolved by @hghianni in #1674
- W-12184902 - Change in emission of unions with null elements by @looseale in #1675
- Added sorted column to clarify in the exported model if an array is s… by @looseale in #1678
- W-11921177: minor refactors and improvements by @arielmirra in #1677
- IRI expansion in JSON-LD Schema by @looseale in #1688
- W-11755322 - Added validation for @type usage by @looseale in #1689
- W-12073855: Add annotation to facilitate linking external schemas by @hghianni in #1690
- W-12073855: Change TargetName annotation to store name as YPart inste… by @hghianni in #1692
- W 12218465 by @damianpedra in #1687
- Add setters for property and values at jsonldobject, cloning the inst… by @pope1838 in #1695
- (interface): make withAliases public by @tomsfernandez in #1697
Full Changelog: 5.2.2...5.2.3
5.2.2
Model Changes
Payload
: addedrequired
fieldEndPoint
: addedEndpointFederationMetadata
field. EndPoints can now contain metadata about to federation capabilitiesParameter
: addedParameterFederationMetadata
field. EndPoints can now contain metadata about to federation capabilities
RenderOption changes
- added
withoutImplicitRamlTypes
option to avoid rendering thetype
entry of Raml types when it can be inferred from the type's properties. Thanks to @Shadow-Devil for the contribution.
Validation changes
- examples and default values with 'null' value were not validated against the Shape. Those values are validated now.
The error was in the example/default collector, not in the validation itself. In payload validation, it was always validated correctly.
Scala Bump
We upgraded the version of the scala-library to 2.12.13
Interface Changes
The interface changes reflect the model and render option changes described above.
What's Changed
- JSON-LD Schema PoC by @tomsfernandez in #1627
- W-11756604, W-11861750, W-11756966: added support to @container in JS… by @looseale in #1628
- W-11756604: added doc to JsonLDInstanceDocumentModel by @looseale in #1629
- W-11756604: another fixes in doc and model locations by @looseale in #1631
- Update npm README by @hghianni in #1632
- W-11818324: Bump model version -> 3.8.0 by @hghianni in #1633
- W-11698494 - Changed reference collector for JSON references by @looseale in #1636
- W-11861760 (feat): added array item type narrowing based on the content of arrays in an instance by @tomsfernandez in #1637
- Publish 5.3.0 snapshot by @damianpedra in #1640
- W-11778938: Fix null value location by @hghianni in #1635
- Support empty files at antlr based plugins by @pope1838 in #1641
- W-11970750 - Hack in DataType client convertion by @looseale in #1643
- (ci): added Github Action to run tests in the Windows platform. Action is triggered manually by @tomsfernandez in #1645
- W-11732773 - Added a parameter with a default value to limit nesting … by @looseale in #1644
- W-11755356 - Added tests of @characteristics (valid and invalid cases) by @looseale in #1646
- W 11754577/property term collisions - W-11754747/jsonld-schema-id-adoption by @tomsfernandez in #1630
- W 11918512: Fix typings by @hghianni in #1647
- W-11755406 - Added test of @characteristics parsing in property by @looseale in #1648
- W-11991575 - Increase payload size in test depth due fix in syaml by @looseale in #1649
- Update graph class typings by @pope1838 in #1651
- W-11989055: fix CastClassException in PropertykeyMapping.target by @damianpedra in #1652
- publish 5.2.1 rc.1 by @nschejtman in #1655
- Bump amf-aml to 6.2.1-RC.1. Publish 5.2.1-RC.2 by @looseale in #1656
- Publish 5.2.1 by @looseale in #1659
- Publish 5.2.1 by @looseale in #1661
Full Changelog: 5.2.1...5.2.2
5.2.1
What's Changed
- JSON-LD Schema PoC by @tomsfernandez in #1627
- W-11756604, W-11861750, W-11756966: added support to @container in JS… by @looseale in #1628
- W-11756604: added doc to JsonLDInstanceDocumentModel by @looseale in #1629
- W-11756604: another fixes in doc and model locations by @looseale in #1631
- Update npm README by @hghianni in #1632
- W-11818324: Bump model version -> 3.8.0 by @hghianni in #1633
- W-11698494 - Changed reference collector for JSON references by @looseale in #1636
- W-11861760 (feat): added array item type narrowing based on the content of arrays in an instance by @tomsfernandez in #1637
- Publish 5.3.0 snapshot by @damianpedra in #1640
- W-11778938: Fix null value location by @hghianni in #1635
- Support empty files at antlr based plugins by @pope1838 in #1641
- W-11970750 - Hack in DataType client convertion by @looseale in #1643
- (ci): added Github Action to run tests in the Windows platform. Action is triggered manually by @tomsfernandez in #1645
- W-11732773 - Added a parameter with a default value to limit nesting … by @looseale in #1644
- W-11755356 - Added tests of @characteristics (valid and invalid cases) by @looseale in #1646
- W 11754577/property term collisions - W-11754747/jsonld-schema-id-adoption by @tomsfernandez in #1630
- W 11918512: Fix typings by @hghianni in #1647
- W-11755406 - Added test of @characteristics parsing in property by @looseale in #1648
- W-11991575 - Increase payload size in test depth due fix in syaml by @looseale in #1649
- Update graph class typings by @pope1838 in #1651
- W-11989055: fix CastClassException in PropertykeyMapping.target by @damianpedra in #1652
- publish 5.2.1 rc.1 by @nschejtman in #1655
- Bump amf-aml to 6.2.1-RC.1. Publish 5.2.1-RC.2 by @looseale in #1656
- Publish 5.2.1 by @looseale in #1659
- Publish 5.2.1 by @looseale in #1661
Full Changelog: 5.2.0...5.2.1
Changes in 5.2.0
OpenApi 3.0 Component
We're happy to announce that AMF now supports OpenApi 3 Component
An "OpenApi 3 Component" is a semantically valid OpenApi API spec that is defined with an empty Paths Object.
The reason for writing a file of this type is to be able to reuse any item within the Components Object throughout several APIs.
For more info and examples check out the OpenApi 3 Component section of the AMF Documentation.
What's Changed
- (chore): use lowercase 'introspection' instead of 'Introspection' in GraphQLIntrospectionPipeline. Delegate to ENUM by @tomsfernandez in #1600
- W-11558536 (feat): added validations for oas components by @tomsfernandez in #1597
- (test): added comment to test by @tomsfernandez in #1595
- W-11554068 by @nschejtman in #1603
- W 11778719 by @nschejtman in #1602
- W 11781292 by @nschejtman in #1608
- W-11631501 (fix): fixed regression regarding Json Schemas in RAML by @tomsfernandez in #1609
- Fix typings generation by @nschejtman in #1612
- W-11697864/json-schema-fix by @tomsfernandez in #1613
- (typings): updated typings by @tomsfernandez in #1614
- W-11697864: test json schema nested ref by id by @arielmirra in #1615
- W-11730600: Fix simplified union annotations were lost during transformation by @hghianni in #1617
- W-11787652: Fix some Json Schema bugs by @hghianni in #1616
- W-11787652: Change displayName for new fields by @hghianni in #1618
- W-11350149: adopt VirtualElement changes from core, and some minor refactors by @arielmirra in #1619
- W-11350149: revert annotation traits changes and adopt core changes by @arielmirra in #1621
- W-11785261 - Fixed root references from JSON Schema Documents by @looseale in #1620
- W-11830050 - push endpoint cookie parameters to operations by @damianpedra in #1624
- W-11350149: Add lexical to implicit parameters by @hghianni in #1623
New Contributors
- @damianpedra made their first contribution in #1624
Full Changelog: 5.1.0...5.2.0
Changes in 5.1.0
Announcing GraphQL and Apollo Federation support
We're happy to announce that AMF now supports GraphQL APIs and Apollo Federation APIs for all its operations (parsing, transformation, validation, rendering).
We've worked hard to integrate all GraphQL features into our model, up to the October 2021 GraphQL Spec.
How to use GraphQL in AMF
To use these new features you only need to:
- create a new
GraphQLConfiguration.GraphQL()
- create a client
graphqlConfig.baseUnitClient()
- use this client to parse, transform, validate and render GraphQL APIs
There are multiple examples of GraphQL parsing in Scala, Java, and TypeScript in the GraphQL Parsing section of the AMF Documentation.
Apollo Federation
We've also added support for GraphQL APIs compliant with the Apollo Federation v2 Spec.
These APIs require a different configuration called GraphQLFederationConfiguration.GraphQLFederation()
to differentiate them from plain GraphQL APIs.
We've detailed exactly what is supported and how it works in the GraphQL Federation section of the AMF Documentation.
Resources
Specification | Configuration | More information |
---|---|---|
GraphQL | GraphQLConfiguration |
GraphQL Parsing |
Apollo Federation | GraphQLFederationConfiguration |
GraphQL Federation |
What's Changed
- W-11580922: validate required fields by @arielmirra in #1542
- W-11349298: Split duplicated paths detection logic by @hghianni in #1546
- W-11618110: return a new error handler in every request to the eh provider in shape validation by @arielmirra in #1548
- W-11495708 - Fixed search of JSON declared node with encodeable chars by @looseale in #1549
- Directives emission by @hghianni in #1553
- Add properties field in oas parser if properties entry is present by @pope1838 in #1554
- graphql 2021 by @nschejtman in #1555
- some fixes by @nschejtman in #1561
- W-11581261: Add link directive to GraphQL Federation by @hghianni in #1563
- GraphQL Fixes by @hghianni in #1565
- W 11460908 by @nschejtman in #1566
- W-11086896: add @key validations for graphql federation by @arielmirra in #1564
- W-11574054: test interfaces that implement interfaces + other fixes by @arielmirra in #1567
- W-11558453, W-11558514: added OAS Component classes, plugin, parser, … by @looseale in #1570
- W-11469432: add test to check tracked element cloning by @pope1838 in #1571
- W-11558453, W-11558514: revert NamedDomainElement name change in plat… by @looseale in #1573
- W-11574022: test covariance in a chain of interfaces by @arielmirra in #1568
- W-11558604: added support for oas3 components document indexing by @tomsfernandez in #1572
- fix: removed com.sun.tools import by @tomsfernandez in #1575
- W-11574043: add repeatable directive emission by @arielmirra in #1574
- W 11574036 by @nschejtman in #1577
- W 11645489 - Added references to JSON Schema Document by @looseale in #1578
- W-11574070: add matrix initial support & examples to graphql tck by @arielmirra in #1580
- W 11542569 by @nschejtman in #1576
- W-11646230: Add ANTLR errors to Parse report by @hghianni in #1579
- Adopt NpmOpsPlugin changes from amf-antlr-ast by @nschejtman in #1582
- W 11690311 by @hghianni in #1583
- argument parsing and rendering by @nschejtman in #1581
- W-11690333: fix schema emission logic, update dumped graphql goldens by @arielmirra in #1584
- W-11718652 (fix): implemented max json depth level for application/json strict validation by @tomsfernandez in #1586
- W 11691599 by @nschejtman in #1587
- W 11460908: bunch of GraphQL fixes (pack 1) by @nschejtman in #1588
- W 11740498 by @nschejtman in #1589
- W-11748903: Add description to directive args & fix directive descrip… by @hghianni in #1590
- W-11721862: validate cyclic inheritance in GraphQL by @arielmirra in #1593
- W-11460908: bump AMF model -> 3.7.0 by @nschejtman in #1596
- W-11558572 - Added tests for cross-spec validation and updated OAS Co… by @looseale in #1591
- W-11517554 - Update typings by @looseale in #1598
Full Changelog: 5.0.12...5.1.0
Changes in 5.0.12
What's Changed
- W-11047366: validate input types in graphql by @arielmirra in #1506
- W-11460908: fix descriptions parsing in GraphQL by @nschejtman in #1510
- release/5.0.11 to develop by @looseale in #1515
- W-11460908: fixed non-federation directives parsing in federation by @nschejtman in #1512
- W-11425840: fix position and range in various reports by @arielmirra in #1517
- W-11086996: added introspection types for GraphQL Federation transformation by @tomsfernandez in #1518
- W 11309346 by @nschejtman in #1516
- W-11047389: validate output fields by @arielmirra in #1520
- W-11046869: validate missing arguments in graphql directives by @arielmirra in #1522
- W-11087059/extend-query-introspection by @tomsfernandez in #1521
- W 11086840 by @nschejtman in #1523
- W-11274653: Add GraphQL + Federation to SourceMapsAnnotationsTest by @arielmirra in #1524
- W 11086914 by @nschejtman in #1525
- W 11047867 by @nschejtman in #1527
- W-11404638: Fix missing example validation in Union by @hghianni in #1526
- Added code format to URIs in the model to avoid link formatting by @looseale in #1528
- W-11539428: fix parsing directive applications within directive declarations by @nschejtman in #1529
- W-11086790/graphql-validations-federation by @tomsfernandez in #1530
- Fixed JsonSchemaConfig client interface by @looseale in #1531
- Added JsonSchemaDocument wrapper by @looseale in #1533
- W-11090478: GraphQL Rendering Setup by @arielmirra in #1532
- W 11542738 by @nschejtman in #1534
- W-11460908: make custom scalars of type xsd.any without format by @nschejtman in #1535
- W-11548738, W-11090489 & W-11548639: GraphQL emission by @hghianni in #1536
- W 11541069 by @nschejtman in #1537
- Added missing GraphQL typing by @looseale in #1538
- W-11437709: Move validations from Parsing to Validation stage by @hghianni in #1539
- W-11542455: adopted new amf-antlr-parsers npm package to fix JS exported execution by @tomsfernandez in #1540
- W-11578656: Refactor GraphQL emitters by @hghianni in #1541
- W-11349298: Fix duplicated resource path in OAS by @hghianni in #1544
- Add properties field in oas parser if properties entry is present (#1… by @looseale in #1556
Full Changelog: 5.0.11...5.0.12
Changes in 5.0.11
JSON Schema Document
Added support to JSON Schema
Now you can operate with JSON Schema documents as root level elements in AMF.
You can parse, validate and resolve JSON Schemas draft 3, 4, 7, and 2019-09 (in the last case there are some unsupported features, like meta-schema).
How to use it
You need to create a JsonSchemaConfiguration
. The other functionalities are quite the same as working with APIs.
val client = JsonSchemaConfiguration.JsonSchema().baseUnitClient()
for {
parsingResult <- client.parse("file://pathToYourFile.json")
validationReport <- client.validate(parsed.baseUnit)
} yield {
(...)
}
The parsed BaseUnit
will be a JsonSchemaDocument
. This new kind of Document
will have a Shape
containing the base schema in the encodes
and a list of Shape
in the declares
containing the schemas under the declaration key. The declaration key must be declarations
for the draft before draft 2019-09 and $defs
or declarations
for draft 2019-09.
To take into account
- The
$schema
key specifying the draft isMANDATORY
. - There only could be one declaration key at the same time (
$defs
ordeclarations
, not both). If not, an error will be shown. - In the validation stage, some basic model validations are applied to the schemas.
- In the validation stage, examples, defaults, and enum values are validated.
- For compatibility reasons, the JSON Schemas processed with other configurations are not parsed as a
JsonSchemaDocument
.
e.g.: if you parse an OAS API with an OAS configuration, and that OAS API has references to a JSON Schema file. That file is still processed as anExternalFragment
.
What's Changed
- W-11233146: fix some interface methods by @arielmirra in #1454
- W-11241856: make validation severity thrown by ApiContractFallbackPlugin customizable by @nschejtman in #1463
- W-11178013: complete refactor of the Raml Json Schema Parser, reference parsing in OAS and parsing context methods. by @tomsfernandez in #1451
- Adopt new ast annotation. Minor graphql changes by @pope1838 in #1325
- chore: bumped amf-antlr-ast to 0.5.1 by @tomsfernandez in #1468
- add ADR 11: annotations lifespan interfaces by @arielmirra in #1466
- W-11047847 & W-11047858 by @arielmirra in #1469
- Define amf-antlr version at .versions file by @pope1838 in #1470
- W 11063850 by @nschejtman in #1467
- W-11047878: Add invalid name validation for GraphQL by @hghianni in #1471
- W-11027843: Add duplicated field validation for GraphQL by @hghianni in #1472
- W-11063850: more boilerplate by @nschejtman in #1474
- W-11046724: Add duplicated argument validation for GraphQL by @hghianni in #1473
- W-11131240 - Updated json and other dependencies by @looseale in #1476
- W-11046729 & W-11047884 validations by @hghianni in #1477
- add cache pipeline to graphql validation tests by @arielmirra in #1478
- W-11046870: add initial graphql validation by @arielmirra in #1459
- W 11386887/debt/shape parser context refactor by @tomsfernandez in #1475
- W-11415904: Fix only parsing one interface implementation in GraphQL by @hghianni in #1480
- W-11047651: validate that union members must be object type by @arielmirra in #1481
- W 11046755, W-11046765 & W-11046733 validations by @hghianni in #1483
- Json schema fragment base classes by @looseale in #1485
- W-11415653 - Adding missing modelDoc to JsonSchemaDocument by @looseale in #1486
- W-11343511: minor graphql refactors by @arielmirra in #1484
- W-11086511: added Federation TCK by @nschejtman in #1487
- W-11178130 - Added adapter needed from APB to implement JSON Schema F… by @looseale in #1488
- W-10672168: Fix some lexicals in GraphQL by @hghianni in #1489
- Add builder for json schema at api configuraiton. Implement registrer… by @pope1838 in #1493
- W-11046889: validate empty definitions by @arielmirra in #1494
- Add JsonSchema configuration tests by @pope1838 in #1496
- W 11178034/feat/json document refs by @tomsfernandez in #1491
- W-11410812 - Support in draft 2019 as declarations key along with by @looseale in #1495
- W-11086555: added Federation model by @nschejtman in #1479
- W-11460908: fix scaladoc by @nschejtman in #1499
- W-11046845: validate required fields in graphql by @arielmirra in #1497
- W-11178034: added check by ref origin in external fragment reference resolution for APB compatibility by @tomsfernandez in #1498
- W-11456734 - Added validation for Json Schema Configuration by @looseale in #1500
- W 11412688 by @nschejtman in #1501
- W-11470045 - Change severity of multiple def keys to violation and ad… by @looseale in #1503
- W-11415930 - Added resolution suite by @looseale in #1504
- W-11460908 - Bump model version due changes in GraphQL model by @looseale in #1505
- update typings with federation and jsonschema types by @arielmirra in #1511
Full Changelog: 5.0.10...5.0.11