Giter VIP home page Giter VIP logo

oatyp's Introduction

Hi there 👋

I am a french software engineer currently working at @datadog. I've learn to code in 2013 with a Minecraft free CMS and I've kept working on side projects during my studies, the biggest one is @MineWeb.

  • 📗  Ex-42born2code's student from nov. 2017 to feb. 2018
  • 👨‍💻  Previously doing some Typescript and infrastructure at @keymetrics from feb. 2018 to sep. 2019
  • 👨‍💻  Previously lead core engineer at @reelevant mostly doing Typescript and some Rust from sep. 2019 to dec. 2023
  • →  Currently Software Engineer II at @datadog doing some Golang since jan. 2024

Skills

✍️ Languages

💾 Databases / queues

I've used Redis, MongoDB, done some SQL on MariaDB, SQLite and Google BigQuery. And I've deployed and used Apache Pinot, Apache Pulsar and ElasticSearch.

🛠 Tools

I'm currently working with Git, Docker built via Github Actions and deployed on Kubernetes.

I've previously deployed Hashicorp Nomad and Hashicorp Consul via Hashicorp Terraform and used DroneCI as CI/CD.

oatyp's People

Contributors

brycebarbara avatar eywek avatar f-hj avatar florianmartens avatar vmarchaud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

oatyp's Issues

Date format annotations should not convert to Date type

OpenAPI supports format annotations for strings such as ´"cancelledAt": { "format": "date-time", "type": "string" }´. As is, this library converts this to a type like

type Model {
   cancelledAt: Date
}

Since JSON obviously does not support the object based Date type, the actual type of this object would be:

type Model {
   cancelledAt: string
}

Bug Report: Cannot read nullable types for nested references

For this OA definition:

"OrganizationEntity": {
    "type": "object",
    "properties": {
        "id": { "type": "string" },
        "updatedAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true
        },
        "createdAt": { "format": "date-time", "type": "string" },
        "name": { "type": "string" },
        "licenseType": {
            "type": "string",
            "enum": [
                "FREE",
                "ESSENTIAL",
                "BUSINESS",
                "PROFESSIONAL",
                "SPONSORED"
            ]
        },
        "cancelledAt": { "format": "date-time", "type": "string" },
        "stripeCustomerId": { "type": "string" },
        "stripeSubscriptionId": {
            "type": "string",
            "nullable": true
        },
        "currentBillingPeriodEndsAt": {
            "format": "date-time",
            "type": "string",
            "nullable": true
        },
        "paymentStatus": {
            "type": "string",
            "enum": ["EXPIRED", "PAIMENT_FAILED"]
        },
        "licenseOverwrite": {
            "nullable": true,
            "allOf": [
                {
                    "$ref": "#/components/schemas/LicenseOverwriteEntity"
                }
            ]
        },
        "slug": { "type": "string" },
        "licenseId": { "type": "string" }
    },
    "required": [
        "id",
        "updatedAt",
        "createdAt",
        "name",
        "licenseType",
        "cancelledAt",
        "stripeCustomerId",
        "stripeSubscriptionId",
        "currentBillingPeriodEndsAt",
        "paymentStatus",
        "licenseOverwrite",
        "slug"
    ]
}

This library generates the following type:

export type OrganizationEntity = {
    id: string;
    updatedAt: Date | null;
    createdAt: Date;
    name: string;
    licenseType: "FREE" | "ESSENTIAL" | "BUSINESS" | "PROFESSIONAL" | "SPONSORED";
    cancelledAt: Date;
    stripeCustomerId: string;
    stripeSubscriptionId: string | null;
    currentBillingPeriodEndsAt: Date | null;
    paymentStatus: "EXPIRED" | "PAIMENT_FAILED";
    licenseOverwrite: LicenseOverwriteEntity;
    slug: string;
    licenseId?: string;
};

Although the correct type would be:

export type OrganizationEntity = {
    id: string;
    updatedAt: Date | null;
    createdAt: Date;
    name: string;
    licenseType: "FREE" | "ESSENTIAL" | "BUSINESS" | "PROFESSIONAL" | "SPONSORED";
    cancelledAt: Date;
    stripeCustomerId: string;
    stripeSubscriptionId: string | null;
    currentBillingPeriodEndsAt: Date | null;
    paymentStatus: "EXPIRED" | "PAIMENT_FAILED";
    licenseOverwrite: LicenseOverwriteEntity | null; <- WE NEED A NULL HERE
    slug: string;
    licenseId?: string;
};

Sample swagger.json file: https://gist.github.com/florianmartens/ee1623903cb55037d15ef6796e43f720

Optional properties are assigned inverse?

This is such a great library that saves me a ton of time. I'm super grateful it exists! I have a small issue as illustrated below:

profile.entitiy.ts

export class ProfileEntity implements Profile {
    @ApiProperty()
    id: string;

    @ApiProperty()
    createdAt: Date;

    @ApiProperty()
    updatedAt: Date;

    @ApiProperty({ required: false })
    address: string;

    @ApiProperty({ required: false })
    city: string;

    @ApiProperty({ required: false })
    countryCode: string;

    @ApiProperty({ required: false })
    phone: string;

    @ApiProperty({ required: false })
    twitterLink: string;

    @ApiProperty({ required: false })
    linkedInLink: string;

    @ApiProperty()
    userId: string;
}

Generated type

export type ProfileEntity = {
    id?: string;
    createdAt?: Date;
    updatedAt?: Date;
    address: string;
    city: string;
    countryCode: string;
    phone: string;
    twitterLink: string;
    linkedInLink: string;
    userId?: string;
};

It seems to be as if the optional ? is appended inverse to the way it should be {required: false} should result in the type being optional and vice versa.

This happens to all my types (the above is just an example).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.