Oh Boy Look At These API Endpoints. Seriously

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024

ความคิดเห็น • 74

  • @kenng2029
    @kenng2029 ปีที่แล้ว +3

    I've purchased your course and found them really useful - keep up the unbelievable work! Thanks for the continuous content amigo!

  • @heduardos26
    @heduardos26 ปีที่แล้ว +5

    We need that video! API design best practices

  • @maksimpatapenka2076
    @maksimpatapenka2076 ปีที่แล้ว +8

    I don't think that endpoint api/v1/cars/users/{userId} follows the REST semantics. The operation looks like filtration "give me the cars of the user with id = x" - so fo this purposes query parameters work well. So the proper way of implementing this endpoint will be GET api/v1/cars?userId=xxx
    Regarding export operations, just use headers to specify content you want. For example GET /invoices/123 produce by default JSON object, by if we use content type and accept headers to specify that caller needs application/pdf the response will be returned as PDF file with invoice details

  • @kevinlang5873
    @kevinlang5873 ปีที่แล้ว +13

    You should make a video about DTO's and when to use then! Would help a lot.

    • @Japhu
      @Japhu ปีที่แล้ว

      It's not rocket science just google it if you really don't know

    • @alexandrua6121
      @alexandrua6121 ปีที่แล้ว +3

      you should use them when you want to transfer data via an object

    • @davidblbulyan3077
      @davidblbulyan3077 ปีที่แล้ว +1

      You should use them when you want to transfer an entity to user, because transfering entities directly means that you load all data from DB, including @OneToMany, @ManyToOne relationships

  • @alexanderlee1199
    @alexanderlee1199 ปีที่แล้ว

    thanks! i was literally gonna do some research into endpoints for spring boot today and saw you uploaded this today.

  • @nikolas4786
    @nikolas4786 ปีที่แล้ว +11

    Hi alibou, can you make the frontend part of your JWT code, with react or angular, preferably react, your tutorial was very helpful to me, but i would like a frontend to understand it better

  • @rdkrussel
    @rdkrussel ปีที่แล้ว +28

    Lol these look like some of the endpoints on the project I'm working on at my job. I've tried to raise the flag. The whole code base is littered with terrible conventions but no one else seems to care

    • @angelsv
      @angelsv ปีที่แล้ว +3

      time to find another job then, good luck

    • @rdkrussel
      @rdkrussel ปีที่แล้ว

      @@angelsv yep. Just got off of LinkedIn lol

    • @feezankhattak1573
      @feezankhattak1573 ปีที่แล้ว

      /v1/api/products, but when it comes to aws api gateway, this gives the error, the aws api gateway expect /v1,/v1/api, and /v1/api/products a separate endpoints and expect a swager definition for each.....

    • @ArekTheBoss
      @ArekTheBoss ปีที่แล้ว

      So maybe it is good time to change company/project?

    • @rdkrussel
      @rdkrussel ปีที่แล้ว

      @@ArekTheBoss yes I'm working on it. Market is kinda slow right now and probably very saturated

  • @michaelmartinez5047
    @michaelmartinez5047 ปีที่แล้ว +2

    Great video! Good examples. Looking forwards to an API design best practices video!

  • @stefanoriffaldi84
    @stefanoriffaldi84 ปีที่แล้ว

    hola Amigo

  • @gleb4a
    @gleb4a ปีที่แล้ว

    very excited for the API design video!

  • @kenng2029
    @kenng2029 ปีที่แล้ว +5

    I have a question about the content. Let's suppose you want to have a system which provides open access to anyone on the platform (e.g. unpaid customers) and 'secured' access to paid customers - what would the recommended naming convention be for good REST semantics?
    Thanks again for the content Nelson!

    • @CamembertDave
      @CamembertDave ปีที่แล้ว +5

      I would suggest not including that distinction in the endpoint names. For example, you could have GET /books be open access and POST /books require authentication. Just name your endpoints based on what the resources are.

  • @michelchaghoury9629
    @michelchaghoury9629 ปีที่แล้ว +3

    @Amigoscode please can you make a tutorial on OpenAPI (Swagger versioning) with Spring Boot

  • @Batman12thy
    @Batman12thy ปีที่แล้ว +1

    you can configurate the requestMapping in your appication.propreties like that "server.servlet.context-path=/api/v1" after that when you use your and point you just ahave to gave him the name of your implementation .

  • @koralik6258
    @koralik6258 ปีที่แล้ว +1

    thanks, I had same endpoints in my app (it's running on production btw), it made me laugh, also good lesson :)

  • @javierdetena8830
    @javierdetena8830 ปีที่แล้ว +1

    Hi Nelson! Could you make a video on hexagonal architecture?

  • @ayuobmousa6589
    @ayuobmousa6589 ปีที่แล้ว

    that was awsome, waiting .. for REST design Best Practice video

  • @nick4bizz42
    @nick4bizz42 ปีที่แล้ว +1

    considering taking Java from your master class, but have this mentality that its hard.

  • @fahrican9708
    @fahrican9708 ปีที่แล้ว

    great code review!

  • @LeszekChojnacki
    @LeszekChojnacki ปีที่แล้ว

    Love this video convention, Thanks ;)

  • @sovrinfo
    @sovrinfo ปีที่แล้ว

    Great video! Thanks!

  • @otabek2624
    @otabek2624 ปีที่แล้ว

    Aka muxlisizmiz videolariz zo'r!

  • @MuresanVladMihail
    @MuresanVladMihail ปีที่แล้ว

    Keep up the good work!

  • @Guillen8606
    @Guillen8606 ปีที่แล้ว

    Hi Nelson, in the next video can you also mention versioning practices for apis in spring boot please.

  • @public1303
    @public1303 ปีที่แล้ว +1

    Please vedio about serving file in spring boot with file system

  • @aminetali7388
    @aminetali7388 ปีที่แล้ว

    Thank you we are waiting for api design best practice

  • @namminh4336
    @namminh4336 12 วันที่ผ่านมา

    Wow! That video i need ♥

  • @erickjhormanromero6905
    @erickjhormanromero6905 ปีที่แล้ว +1

    It also unsecure to use entities to bind request direclty.

  • @abdourahmanesall520
    @abdourahmanesall520 ปีที่แล้ว +1

    Hi Nelson, is it better to inject Repository or Service in another service class (to avoid circular injection)?

  • @huytrinh3823
    @huytrinh3823 ปีที่แล้ว +3

    i like your intellij theme, what is the name of your theme?

  • @bill-ys6hx
    @bill-ys6hx ปีที่แล้ว +1

    Bro please can you do your day in the life?

  • @VishalPal-zy7cc
    @VishalPal-zy7cc ปีที่แล้ว

    Can u kindly make a vdo on white label error router to methods so that any responseEntity be sent

  • @ArisAris-fs1ip
    @ArisAris-fs1ip ปีที่แล้ว

    I love this hat!

  • @alisheraytbay4041
    @alisheraytbay4041 ปีที่แล้ว +2

    why developers use addresses like "api/v1" ? In most projects from github and in tutorials I see addresses like it

    • @IvanRandomDude
      @IvanRandomDude ปีที่แล้ว +3

      It's api versioning. In this case, it is called URL segment versioning. But it can be done in other ways too. In general, when you have multiple versions of API, the clients need a way to tell you which version they want to use.

  • @KyrosNox
    @KyrosNox ปีที่แล้ว

    The intro music lol.

  • @zuhriddinshamsiddinov4573
    @zuhriddinshamsiddinov4573 ปีที่แล้ว

    Assalamu Alaykum, Take a video about solve problems, please??:))

  • @shivask5543
    @shivask5543 ปีที่แล้ว

    👌!! Thanks!!

  • @DashaZakella1001
    @DashaZakella1001 ปีที่แล้ว

    i will wait best api practics

  • @yutaroogawa
    @yutaroogawa ปีที่แล้ว +1

    Hey, guys. I want to create good endpoints. So I have one question for all of you. How do you design your endpoint when you want to POST multiple pieces of content in one request?

    • @amigoscode
      @amigoscode  ปีที่แล้ว

      What is the content?

    • @yutaroogawa
      @yutaroogawa ปีที่แล้ว +1

      @@amigoscode For example, when there is a Student API, I want to post multiple contents called students. sorry i'm not good at english

  • @DeGoya
    @DeGoya ปีที่แล้ว

    good stuff

  • @erickjhormanromero6905
    @erickjhormanromero6905 ปีที่แล้ว

    Are you using Fleet, aren't you?

    • @kelvinbiserra5207
      @kelvinbiserra5207 ปีที่แล้ว

      no, new UI intellij, Settings -> appearance & Beahavior -> New UI

  • @ms-pf9ow
    @ms-pf9ow ปีที่แล้ว

    👍

  • @nipunlakshank
    @nipunlakshank ปีที่แล้ว

    I literally smashed the like button. Now I can't like again.

  • @jopadjr
    @jopadjr ปีที่แล้ว

    561st...Thanks

  • @peterfrank1572
    @peterfrank1572 ปีที่แล้ว +1

    Dude why would you play into stereotypes with that thumbnail picture ? How's this racist characture relevant to your channel...SMDH!? 🙄

    • @commonsense8412
      @commonsense8412 ปีที่แล้ว +2

      If it makes you feel better, that's an actual person who goes by "Welven Da Great" and not a racist caricature. It must make you feel big claiming another person's appearance portrays racism. Do you shout and holler when you see a person with disabilities on ads?

  • @WalkWithM3
    @WalkWithM3 ปีที่แล้ว

    Good video, keep it up!

  • @serhendiefendi
    @serhendiefendi ปีที่แล้ว

    Selamun Aleyküm Cemaati Müslimin

  • @serhendiefendi
    @serhendiefendi ปีที่แล้ว

    Selamun Aleyküm

  • @Sahil-a-vim-user
    @Sahil-a-vim-user ปีที่แล้ว

    I don't understand some of the edits you made. api/v1/cars/save seems like a more informative name rather than just a POST request on api/v1/cars.

    • @AngelOfDeath943
      @AngelOfDeath943 ปีที่แล้ว +1

      it’s POST, so its gonna save obviously

    • @Sahil-a-vim-user
      @Sahil-a-vim-user ปีที่แล้ว

      @@AngelOfDeath943 Ik it's going to save for a POST request. My question was more towards the naming conventions. I'd argue saving something to a database should always to intentional, and using the save/ seems like a better name rather than just leaving it empty and just relying on POST method

    • @KineticCode
      @KineticCode ปีที่แล้ว +1

      @@Sahil-a-vim-user save is implied from post. because post means you are inserting. you dont need to add get/save naming to the route because POST/GET implies the behaviour. if you do both you are convoluting already defined behaviour.

    • @rdkrussel
      @rdkrussel ปีที่แล้ว

      The post verb tells you it's going to save. If you use a get it tells you it's gonna get something. If you use delete it tells you it's gonna delete something

    • @IvanRandomDude
      @IvanRandomDude ปีที่แล้ว +3

      Don't bother wasting time on stuff like this. It doesn't matter unless you are building public API that obey by the RESTful standard

  • @softwaretestinglearninghub
    @softwaretestinglearninghub ปีที่แล้ว

    Great video, thank you!