Comments (5)
https://app.shortcut.com/larder/story/9176
from backstage-entity-validator.
Amending this slightly because I found that $text
will actually pass the validator. $yaml
and $json
still do not seem to be supported.
from backstage-entity-validator.
Hey, it is confusing, however the linked docs generally talks about the addition of these processors to Backstage, and gives an example with an entity Kind: API.
But if you try the catalog does not accept anything else to the definition field only string. You can see the schema that we use to validate here: https://github.com/backstage/backstage/blob/490d663a55ad1d91850979048b0582056e45517b/packages/catalog-model/src/kinds/ApiEntityV1alpha1.ts#L37
In the case of these substitutions the preprocessor would create a json object to the definition, but the definition should be a json string. That's why it fails.
from backstage-entity-validator.
Yeah, I have a little more context on this now and I realize that the processor essentially reads and parses the contents of these $
-prefixed keys as embedded strings during the catalog ingestion process. However, I've also noticed that $json
and $yaml
either don't work the way I expect or I'm simply using them incorrectly because I've never gotten them to properly fetch data from a remote source, e.g.
kind: API
...
spec:
...
definition:
$yaml: https:///www.example.com/path/to/an/api/definition.yaml # Does not inline into a string
This is probably why they're failing to inline correctly and the validator is treating them as objects. I've never actually seen these work when I try examples like the above. Is it correct to assume the validator is running some kind of code to inline $text
as a string before the validation check is done? If so, and that code is also inlining $yaml
and $json
as intended, then this may be ok to close.
from backstage-entity-validator.
To piggyback off of this one, running into the same issue, but whilst trying to implement an OpenAPI spec.
spec:
type: type
system: system
lifecycle: lifecycle
owner: owner
definition:
$openapi: ./docs/api/oas.yaml
The above will fail validation with the following error:
Failed to validate api/catalog-info.yaml: TypeError: /spec/definition should be string - type: string
I have verified that this does indeed work within Backstage whilst pointing to an OpenAPI spec
from backstage-entity-validator.
Related Issues (20)
- Possible unnecessary entry in schema HOT 6
- Follow links in Location files HOT 2
- The schema should be extendable HOT 2
- Auto-discover metadata files HOT 6
- Referential integrity should be checked HOT 2
- Locations fail without `spec` attribute which is inconsistent with docs HOT 3
- No such file or directory error during CI build HOT 6
- [Question] Entity validator source HOT 3
- Circle CI Orb build not executing integration tests HOT 2
- Orb usage examples are wrong - recommend adding a job to the orb to make them right HOT 2
- Update action to use Node 16 HOT 3
- Validation fails when using `backstage.io/techdocs-ref: dir:.` annotation HOT 4
- Handle nunjucks syntax for template files HOT 1
- Is this maintained? HOT 5
- Support Gitlab Pipelines HOT 3
- techdocs default mkdoc.yaml
- Allow to pass custom spec -> definition for API entity HOT 1
- DependsOn resource syntax error not detected
- Update action to use Node 20
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 backstage-entity-validator.