Comments (3)
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
from parser-js.
Hi @sam0r040!
The issue comes with the library we use for parsing YAML, which is js-yaml.
There are several issues opened on their repository talking about this. For example: nodeca/js-yaml#161
The summary is that, whenever that parser finds a field that is not an explicit string (without quotes), it fallbacks to some schemas. The default one is called "Core" , and is supposed to be based on YAML spec, so whenever it finds a value with the format of date
, it transforms it into a datetime. Means, it transforms from 2015-07-20
to 2015-07-20T00:00:00.000Z
.
As the first and quick solution, I encourage all those values to be enclosed with quotes.
However, I tested their recommendation of using other fallback schemas, in particular the JSON Schema one and the parser is able to parse properly without those errors.
loadedObj = yaml.load(asyncapi, { schema: yaml.JSON_SCHEMA });
All tests are passing, but not 100% sure if adding that could break other documents, so not sure if this possible fix would become a breaking change 🤔
cc @jonaslagoni @magicmatatjahu
from parser-js.
Related Issues (20)
- Parser do not validate and throw error when `parameters` are provided but address is null HOT 4
- Parser do not validate if channel that is referenced in reply with location has `null` in address HOT 6
- Parser returns `undefined` when there's bindings in message HOT 1
- Parser fails to throw an error when i provide an invalid asyncapi file HOT 1
- Inconsistence Parser Methods HOT 2
- .id() doesn't work for `$ref`ed components HOT 1
- Parser fails to return Operation Channel HOT 1
- document.allSchemas() returns "duplicated" schemas HOT 8
- Parser fails to return Operation HOT 1
- Upgrade parser in `next-major-spec` to use latest `@asyncapi/[email protected]`
- Some Spectral Rules for spec v3 should run after resolving references HOT 1
- The automated release is failing 🚨
- Inconsistent `range` Values in Error Diagnostics for Different AsyncAPI File Formats HOT 2
- chained messages().get('xx').operations() call returns unrelated operations HOT 2
- Divide "Maintainer" role into two categories: Triager and Committer HOT 9
- Integrate smoya/multi-parser-js into asyncapi/parser-js HOT 28
- [BUG] message payload schema object cannot be called by parser api HOT 2
- [BUG] Parsing yields error due to correlation between a Channel and Operation HOT 1
- [BUG] schemaValidation does not allow string examples for other schema types HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parser-js.