Every property marked as optional + 'any' types
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- openapi, typescript
Direzione di ricerca
Inizia dal TypeScript interface generator e segui come vengono mappati l’obbligatorietà e i tipi primitivi delle proprietà Swagger/OpenAPI. Confronta l’esempio ContactPerson con il relativo schema, quindi verifica che le proprietà obbligatorie non siano opzionali e che le proprietà documentate di tipo string o date non diventino any.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
API Platform version(s) affected: 3.0
Description
I generated typescript interfaces from a API Platform with this package. This worked really well, but there are two issues that make the result pretty much unusable for me:
- Every property is marked as optional, even '@id'. Having to manual check for every property kinda defeats the purpose of having the interfaces in the first place.
- Some properties are marked as
any, even though there is a proper type in the API docs. E.g.ContactPerson.imageis listed asstringin Swagger, but appears asanyin TypeScript. I also noticed dates beingany– but this was in a API Platform 2.6 project and might not be an issue in newer versions.
Here is an example taken out of my Swagger docs:
{
"hydra:member": [
{
"@context": "string",
"@id": "string",
"@type": "string",
"id": "string",
"name": "string",
"phoneNumber": "string",
"email": "string",
"jobAdvertisements": [
"string"
],
"image": "string"
}
],
"hydra:totalItems": 0,
"hydra:view": {
"@id": "string",
"type": "string",
"hydra:first": "string",
"hydra:last": "string",
"hydra:previous": "string",
"hydra:next": "string"
},
"hydra:search": {
"@type": "string",
"hydra:template": "string",
"hydra:variableRepresentation": "string",
"hydra:mapping": [
{
"@type": "string",
"variable": "string",
"property": "string",
"required": true
}
]
}
}
And this is the generated interface:
export interface ContactPerson {
"@id"?: string;
name?: string;
phoneNumber?: string;
email?: string;
jobAdvertisements?: string[];
image?: any;
}
- Lingua principale
- TypeScript
- Stelle
- 113
- Fork
- 80
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di api-platform/api-doc-parser
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
api-platform/api-doc-parser#130 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
api-platform/api-doc-parser#129 · 1 commento ·
-
api-platform/api-doc-parser#125 · 1 commento · 1 assegnatario ·
-
api-platform/api-doc-parser#115 · 4 commenti · 1 assegnatario ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
api-platform/api-doc-parser#113 ·
Tutte le issue di api-platform/api-doc-parser
Issue simili
-
blocklist removal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pastelsky/bundlephobia#1122 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100